The file position indicator is a conceptual entity used in this document to facilitate exact specification
of the next record to be accessed within a given file during certain sequences
of input-output operations. The concept of a file position indicator has no
meaning for a file opened in the output or extend mode. The setting of the
file position indicator is affected only by the OPEN, READ, RETURN, ROLLBACK
and START statements as follows:
IBM Extension
- For a dynamic access READ FIRST statement, the file position indicator
is positioned to point to the first record in the file; that record is then
made available.
- For a dynamic access READ LAST statement, the file position indicator
is positioned to point to the last record in the file; that record is then
made available.
- For a dynamic access READ PRIOR statement, the file position indicator
is positioned to point to the previous existing record in the file; that record
is then made available.
End of IBM Extension
- For the RETURN statement, the following considerations apply:
- The first RETURN statement positions the file position indicator to the
first record in the file, and that record is then made available.
- If a previous RETURN statement positioned the file position indicator,
the file position indicator is updated to point to the next existing record
in the file, and the record is then made available.
IBM Extension
For the ROLLBACK statement, the following considerations
apply to any file under commitment control:
- The ROLLBACK statement sets the file position indicator to the pointer’s
position at the previous commitment boundary. This is important to remember
if you are doing sequential processing.
- The file position indicator is set to the pointer’s position at the
OPEN if no COMMIT statement has been issued since the file was opened.
- The file position indicator is undefined for any file under commitment
control that is not open.
End of IBM Extension
- The START statement positions the file position indicator to the first
record in the file that satisfies the implicit or explicit comparison specified
in the START statement.
The concept of the file position indicator has no meaning for files with
an access mode of random or for TRANSACTION files.