Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
UNSTRING Clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jdeeponline

New User


Joined: 08 Sep 2009
Posts: 27
Location: Charlotte

PostPosted: Fri Apr 16, 2010 7:18 am    Post subject: UNSTRING Clause
Reply with quote

HI,

I am trying to unstring a long text file into a copybook. I am acheiving this by splitting the field based on a delimiter '|' and applying "UNSTRING" function on it.. However, when two adjacent '|' occur, I would want a low-values/Null to be printed in the target (X'00') rather than spaces. This is because I want to clearly distinguish between the empty fields and the fields that have spaces in the input file.

Right now, the way I have coded it, it seems to be printing spaces for both the cases.

Can someone help me on this?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Apr 16, 2010 7:55 am    Post subject:
Reply with quote

Quote:
However, when two adjacent '|' occur, I would want a low-values/Null to be printed in the target (X'00') rather than spaces
You are correct, zero bytes found/moved results in full blank padding,
You may just have to put up with using the COUNT phrase. Then, after the UNSTRING, move low-values to the into fields when the count field is zero.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 16, 2010 8:48 am    Post subject:
Reply with quote

Hello,

Did you/your organization write the code that creates the "long text"?

Is there any possibility of changing the creation of this text so there will not be adjacent |'s but rather |x'00'| ?
Back to top
View user's profile Send private message
jdeeponline

New User


Joined: 08 Sep 2009
Posts: 27
Location: Charlotte

PostPosted: Fri Apr 16, 2010 8:59 am    Post subject:
Reply with quote

Well the file is being created by a middleware interface based on Java.

But As a work around, using the "COUNT" as William Thompson suggested would work fine I believe.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 16, 2010 9:10 am    Post subject:
Reply with quote

Hello,

Quote:
But As a work around, using the "COUNT" as William Thompson suggested would work fine I believe.
Yes, it should icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts Problem with UNSTRING of CSV data Bill Woodger COBOL Programming 14 Tue Dec 15, 2015 5:32 pm
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts 3-D Table with nested DEPENDING ON Cl... VivekKhanna COBOL Programming 5 Sat Aug 08, 2015 11:18 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us