View previous topic :: View next topic |
Author |
Message |
abhinav343 Beginner
Joined: 12 Jun 2007 Posts: 23 Topics: 12
|
Posted: Mon Jan 14, 2008 1:47 am Post subject: read and write operations in PL/I in LOCATE mode |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Jan 14, 2008 4:55 am Post subject: |
|
|
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 |
|
 |
abhinav343 Beginner
Joined: 12 Jun 2007 Posts: 23 Topics: 12
|
Posted: Tue Jan 15, 2008 12:17 pm Post subject: |
|
|
Thanks Nic...That was very simple way to explain it. |
|
Back to top |
|
 |
|
|