The NEXT RECORD is the next logical record in the key sequence.
For indexed files, the key sequence is the sequence of ascending values of the current key of reference. For relative files, the key sequence is the sequence of ascending values of relative record numbers for records that exist in the file.
Before the READ statement is executed, the file position indicator must be set by a successful OPEN, START, or READ statement. When the READ statement is executed, the record indicated by the file position indicator is made available, if it is still accessible through the path indicated by the file position indicator.
If the record is no longer accessible (because it has been deleted, for
For files in sequential access mode, the NEXT phrase need not be specified.
AT END Condition: If the file position indicator indicates that no next
>_Host_> Under OS/390 and VM, the same procedure occurs as for sequential files (see "At End Condition" in topic 6.2.28.6.1). <_Host_<
If neither an at end nor an invalid key condition occurs during the execution of a READ statement, the AT END or the INVALID KEY phrase is ignored, if specified. The same actions occur as when the at end condition does not occur with sequential files (see "At End Condition" in topic 6.2.28.6.1).
Sequentially Accessed Indexed Files: When an ALTERNATE RECORD KEY with DUPLICATES is the key of reference, file records with duplicate key values are made available in the order in which they were placed in the file.
Sequentially Accessed Relative Files: If the RELATIVE KEY clause is specified for this file, READ statement execution updates the RELATIVE KEY data item to indicate the relative record number of the record being made available.
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.