MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

read and write operations in PL/I in LOCATE mode

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
abhinav343
Beginner


Joined: 12 Jun 2007
Posts: 23
Topics: 12

PostPosted: Mon Jan 14, 2008 1:47 am    Post subject: read and write operations in PL/I in LOCATE mode Reply with quote

Hi All,

I want to understand the read and write operations in PL/I in LOCATE mode. Its bit confusing to me.

Thanks in Advance!!
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Jan 14, 2008 4:55 am    Post subject: Reply with quote

what is confusing you? with locate mode you process the data in the I/O buffers using pointers. To read:
Code:
READ FILE(blahi) SET(ptr);

Your input structure is base on this pointer. The SET keyword tells PL/1 to put the address of the reord just read intis pointer so you can now access it.

For writing:
Code:
 LOCATE record_var FILE(blaho);

This sets a pointer in the output buffer where you can now write the data. Your output structure is based on this pointer. PL/1 takes care of actually writing the data to the file when you issue another LOCATE and a block is filled or at EOJ

Note: there are variations on these statements but the above is the basic process.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
abhinav343
Beginner


Joined: 12 Jun 2007
Posts: 23
Topics: 12

PostPosted: Tue Jan 15, 2008 12:17 pm    Post subject: Reply with quote

Thanks Nic...That was very simple way to explain it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group