Your code issues a get next statement for a serial or relative
record when the related file pointer is at the end of the file. The
pointer is at the end when the last record in the file was accessed by a
previous get or get next statement.
Your code issues a get next statement for an indexed record when
the related file pointer is at the end of file, as occurs in these
situations:
The last record in the file was accessed by a previous get or
get next statement; or
The last record in the file was accessed by a previous set
statement of type set record position when either of these
conditions applies:
The key value matched the key of the last record in the file; or
Every byte in the key value was set to hexadecimal FF. (If a
set statement of type set record position runs with a key
value set to all hexadecimal FF, the statement sets the position pointer to
the end of the file.)
Your code issues a get previous statement for an indexed record
when the related file pointer is at the beginning of file, as occurs in these
situations:
The first record in the file was accessed by a previous get or
get previous statement;
Your code did not previously access the same file; or
A set statement of type set record position ran with a
key when no keys in the file were previous to that key.
A get next statement attempts to retrieve data from an empty or
uninitialized file into an indexed record.
(An empty file is one from which all records have been deleted. An
uninitialized file is one that has never had any records added to it.)
A get previous statement attempts to retrieve data from an empty
file into an indexed record.
In relation to COBOL generation, a get previous statement
attempts to retrieve data from an uninitialized file into an indexed
record.