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
 

 

Reading a file using 'INTO' option.

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

New User


Joined: 29 Jan 2007
Posts: 2
Location: bangalore

PostPosted: Fri Feb 09, 2007 4:05 pm    Post subject: Reading a file using 'INTO' option.
Reply with quote

Hi all,
let us say if Iam reading a file (say xfile) of 192 bytes. The copybook has the following structure.

01 X pic x(192)

01 Y redefines X.
05 rectype pic X(2).
88 type1 value '01'.
88 type2 value '02'.
88 type3 value '03'.
05 recdata pic x(190).

Suppose if I have the statement
Read xfile into X
Then, can I issue a statement like
If type1 perform process-para.
My actual doubt is when we are reading into X can we check a record of Y but redefined to X ? Please clarify. thanks in advance.
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Feb 09, 2007 4:12 pm    Post subject:
Reply with quote

Hi Chandra,

Yes u can .

Because the area occupied by a field in a COBOL layout can be re-used for different data by redefining the original field. This does exactly what it says -- it redefines the space used by a field for another use.
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Fri Feb 09, 2007 7:38 pm    Post subject:
Reply with quote

Of course you can.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Fri Feb 09, 2007 8:34 pm    Post subject:
Reply with quote

Hi !

You could also use:

Evaluate true
When Type-1 Perform Process-1
When Type-2 Perform Process-2
When Type-3 Perform Process-3
When Other Continue
End-Evaluate

Regards, UmeySan
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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