COBOL Manual for TNS/E Programs (H06.03+)

Procedure Division Verbs
HP COBOL Manual for TNS/E Programs520347-003
9-233
START
Effect of Declaratives on Termination
If there is no declarative procedure applicable to the file when the operation is
terminated, the program terminates, and an error message is reported to the
process’s home terminal.
If the applicable declarative procedure is present (but no INVALID KEY phrase is
present) and the time interval expires, the declarative procedure is performed.
Then program execution continues with the imperative statement in the NOT
INVALID KEY phrase, if one is present, or otherwise with the statement following
the one terminated.
Result of Successful Start Operation
A successful start operation identifies a subset of the file’s records that can be
retrieved by subsequent sequential READ statements. The initial record in the
subset is the one located by the search.
When the APPROXIMATE phrase appears, the subset includes all records that
follow the initial record according to the key of reference.
When the GENERIC phrase appears, the subset includes only those records
whose value for the key of reference satisfies the specified relation with respect to
the comparison data-item value. During the execution of subsequent READ NEXT
statements, the at-end condition occurs when the run-time routines detect the end
of the subset.
When neither the APPROXIMATE nor the GENERIC phrase is present, the start
operation behaves as if the APPROXIMATE phrase is present.
When the execution of the START statement is successful, the key of reference
established for the start operation is also used for any subsequently executed
READ NEXT statements for the file, until the execution of some statement explicitly
establishes a different key of reference.
Whenever the start operation is successful, if a NOT INVALID KEY phrase is
specified, control passes to the imperative statement in that phrase. If that
imperative statement does not transfer control elsewhere using a GO TO
statement, control then passes to the end of the START statement.
Result of Unsuccessful Start Operation
When the execution of a START statement is unsuccessful for any reason, the file
position indicator is set to indicate that no valid next record has been established,
and the key of reference for the file is undefined.