klophockey
Programmer
There may be a simple (and maybe obvious) answer to this question but I need a definitive answer and not just my guess.
I have an indexed file that I want to read in a Cobol program. I will open the file as Input just to keep things very simple with respect to the status of the file.
I know for certain I can read the file in a couple of ways. One, is by doing a read using the index key. Another is to just read the file 'next record' and it will begin at the beginning of the file.
MY QUESTION - IS IT ALLOWED TO JUST READ THE FILE RECORD WITH A SIMPLE READ STATEMENT. I would expect the read to put me at the beginning of the file much like the 'Read Next' statement would do if it were used.
The 'Read a record with a key' (Read Filename Key Is File-Key) and 'Read the next record' (Read Filename Next Record) statements work with the file as one would expect
IS THIS A VALID STATEMENT FOR THE FILE DESCRIPTION I HAVE: Read Filex Record
The File Information Is As Follows:
FD Filex.
01 Filex-rec
05 Filex-key Pic 9(3)
05 Filex-data Pic X(127)
Select Filex Assign to FileIn
Organization indexed
Access Dynamic
Record Key Filex-key
Lock mode automatic
Status STATO.
I have an indexed file that I want to read in a Cobol program. I will open the file as Input just to keep things very simple with respect to the status of the file.
I know for certain I can read the file in a couple of ways. One, is by doing a read using the index key. Another is to just read the file 'next record' and it will begin at the beginning of the file.
MY QUESTION - IS IT ALLOWED TO JUST READ THE FILE RECORD WITH A SIMPLE READ STATEMENT. I would expect the read to put me at the beginning of the file much like the 'Read Next' statement would do if it were used.
The 'Read a record with a key' (Read Filename Key Is File-Key) and 'Read the next record' (Read Filename Next Record) statements work with the file as one would expect
IS THIS A VALID STATEMENT FOR THE FILE DESCRIPTION I HAVE: Read Filex Record
The File Information Is As Follows:
FD Filex.
01 Filex-rec
05 Filex-key Pic 9(3)
05 Filex-data Pic X(127)
Select Filex Assign to FileIn
Organization indexed
Access Dynamic
Record Key Filex-key
Lock mode automatic
Status STATO.