For sequential access, the READ statement makes available the next
or previous
logical record from a file. For random access, the READ statement makes available a specified record from a mass storage file.
This restriction is removed.
The storage area associated with identifier and the storage area which is the record area associated with file-name must not be the same storage area.
This rule is not enforced.
or PREVIOUS
phrases must be specified for files in dynamic access mode when records are to be retrieved sequentially.
or
split-key-name
must be the name of a data item specified as a record key associated with file-name.
Data-name may also be a
redefinition of a data-item specified as a record key associated with a
file-name, provided the data-name has the same length as that data-item.
The redefinition may have a different
length from the record key.
or
split-key-name
When the AT END condition occurs,
the execution of the READ statement is unsuccessful.
However if the previous statement was
a READ, and if that READ returned a locked record status, the file position
indicator is left unchanged. The record pointed to by the file position
indicator is made available.
sequential files
or
files in sequential access mode, the NEXT phrase is optional and has no effect on the execution of the READ statement.
The NOT AT END phrase is only executed
following successful completion of the operation.
the next Format 3
READ statement, if any, executed for that file must be a READ NEXT statement,
if AT END occurred because no previous logical record existed. Otherwise
the AT END condition must be followed by:
as described in
General Rule 8.
if the file position indicator was positioned by the execution of the START or OPEN statement and the record is still accessible through the path indicated by the file position indicator, the record pointed to by the file position indicator is made available. If the record is no longer accessible, which can have been caused for a relative file by deletion of the record, or for an indexed file by a change in an alternate key, the file position indicator is updated to point to the next
or, if the
PREVIOUS option is specified, the previous
existing record within the established key of reference, and that record is then made available.
or, if the
PREVIOUS option is specified, the previous
existing record in the file.
However, if the previous statement
was a READ, and if that READ returned a locked record status, the file position
indicator is left unchanged. The record pointed to by the file position
indicator is made available.
or
split-key-name
is established as the key of reference for this retrieval. If dynamic access mode is specified, this key of reference is also used for retrievals by any subsequent executions of Format 3 READ statements for the file until a different key of reference is established for the file.