View previous topic :: View next topic
|
Author |
Message |
Ilavenil
New User
Joined: 16 May 2018 Posts: 4 Location: India
|
|
|
|
Hello All,
I wish to understand more about the EXECIO read parameter OPEN. The manual says that EXECIO will open the dataset and place the cursor based upon linenum parameter. I tried the following statements
Code: |
"EXECIO 3 DISKR INDD (SKIP"
"EXECIO 1 DISKR INDD (FINIS"
"EXECIO 1 DISKR INDD 5 (FINIS"
|
I was expecting an error, but irrespective of not opening the file explicitly, the file has been opened by EXECIO and the data has been returned!
I can understand about FINIS as if we are not closing the file explicitly, it will affect the concurrent execs that are waiting for the dataset based upon the locks. But I could not figure out the practical significance of OPEN. can anybody advice? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
The manual says that EXECIO will open the dataset and place the cursor |
No it does not. The manual says
Quote: |
if you also specify a non-zero value for the linenum operand, EXECIO sets the current record number to the record number indicated by the linenum operand. |
No mention of a cursor.
You use OPEN to explicity open the data set - good programming practice - and set the current record number. This is the equivalent of SKIP on the FIRST (only) access to the data set. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
EXECIO will do an implicit OPEN if the dataset is not already opened. So what you do is not an error.
You will get records 4 and 5 returned in the stack. |
|
Back to top |
|
|
|