IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Tue Mar 27, 2007 2:57 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Tue Mar 27, 2007 4:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts SCOPE PENDING option -check data DB2 2
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts CICS vs LE: STORAGE option CICS 0
Search our Forums:

Back to Top