Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

READ statement......any option available..

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

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Tue Mar 27, 2007 2:54 pm    Post subject: READ statement......any option available..
Reply with quote

Hi all

need ur help in this

my input file has many instructions and it has a LRECL=80 and the each instruction has a delimiter of "/" .I got to validate a instrn starting with some 'ZZZ' and ending with "/" but this instruction consitsts of some 4 lines.i.e,teh "/" is encountered after i ahev read teh 4th line only and also the 4 lines shud be moved to a ws-field.instead of checking byte by byte is there any other way of doing it?(i'm performing 4 reads to get teh 4 lines) and also i know that the "/" for this 'ZZZ' instrn will not be encountered in the first line itself ....i.e,more than one read is needed in this case.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Tue Mar 27, 2007 2:57 pm    Post subject:
Reply with quote

Try to give several examples of your input and several examples of your expected output.
Back to top
View user's profile Send private message
poongs
Warnings : 1

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Tue Mar 27, 2007 3:07 pm    Post subject:
Reply with quote

my input instrn has

zzz+jhdfjkshgd+sjdhfjkdshfjd+bmmnv+1234+
54542+5454+
hgadhghf+gfhdshgfj+1234+uhdfh+
jhgfhja+kjhfk+/

and i want to separate every field in tehis instrn with a delimiter of '+' and i got to get teh 13th field for storing in my table.Once i have read the whold insrtn till teh '/' i'll unstring it get the 13th filed.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Tue Mar 27, 2007 4:59 pm    Post subject:
Reply with quote

I think you are already well on your way to success.
Read the 4 records in to 4 contiguous storage areas (in a row).
Unstring the 320 byte area into 12 dummy slots and the 13th one to save delimiting on both "+" and space.
Assuming the only imbeded spaces are trailing each record and not in the actual data:
UNSTRING WS-320 DELIMITED BY '+' OR ALL SPACES INTO
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-JUNK
WS-13TH
I think that might work, but I'd test it once or twice before putting it into production.....
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us