COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-245
START
TIME LIMIT Phrase
If the TIME LIMIT phrase appears, the time limit operand is evaluated and
rounded, if necessary, to include at most two fractional digits. When the result is
negative, the TIME LIMIT phrase does not apply, and the operation is not subject
to a time limit; otherwise, the result specifies the time interval, in seconds, within
which the start operation must complete. The start operation fails if an acceptable
record cannot be located within the time interval specified.
If the TIME LIMIT phrase is specified with a nonnegative value, and the file is not
opened with time limits enabled, the program terminates with an I-O status code
“90,” and a message, “File is not opened for timed I-O,” is delivered to the
process’s home terminal.
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.