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
 

 

Logic of using 'READ FILE' while reading

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

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Mon Mar 22, 2010 3:23 pm    Post subject: Logic of using 'READ FILE' while reading
Reply with quote

Hi All,

Can any one tell me whats the logic of using 'READ FILE' while reading a file while we use 'WRITE RECORD FROM' during file writting.

Regards
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Mar 22, 2010 4:33 pm    Post subject:
Reply with quote

I'm not very sure about the question but most probably Manuals have the answers on READ and WRITE COBOL verbs!
Back to top
View user's profile Send private message
arun nehra

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Mon Mar 22, 2010 5:21 pm    Post subject: CICS Question
Reply with quote

In simple words, why we can't go for 'WRITE FILE' (normally we go by 'WRITE RECORD' corresponding to the above file) in cobol program the same way as we go for 'READ FILE'.

I am not sure if i can get the answer to above question in the manuals.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Mon Mar 22, 2010 5:31 pm    Post subject:
Reply with quote

You READ a FILE because COBOL does not know how long the record is (in the case of variable length records) and hence you cannot specify a record name. You WRITE a RECORD because you have to tell COBOL which record (implied: the record length in the case of variable length files) to write out of all the 01 definitions in the FD. And this has been the way COBOL has been, probably back to the first compilers.
Back to top
View user's profile Send private message
arun nehra

New User


Joined: 29 Nov 2008
Posts: 62
Location: mumbai

PostPosted: Mon Mar 22, 2010 5:50 pm    Post subject: COBOL Question
Reply with quote

Thanks Robert, That's exactly what i was looking for.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Mon Mar 22, 2010 6:08 pm    Post subject:
Reply with quote

Glad to hear it helped.
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