COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
• Invalid-Key Condition
If the START statement contains the INVALID KEY phrase, control passes to the imperative
statement in that phrase, and no USE procedure is executed. If the START statement does not
contain an INVALID KEY phrase, but an applicable USE procedure exists, that procedure is
executed.
• Key Data Item
The data item specified by key is the comparison data item for the start operation. When this
data item is a file key data item, that key is the specified key for the start operation; otherwise,
the file key data item of which key is a leftmost subordinate specifies the file key for the start
operation.
The key data item can be reference-modified. It can be a level 66 (RENAMES) item.
key can also be an item whose description contains a REDEFINES clause or subordinate to
an item whose description contains a REDEFINES clause. The redefining data item and, in the
latter case, the data item subordinate to the redefining item must contain the leftmost character
positions of the redefined data item.
When the KEY phrase does not appear, the start operation behaves as if the START statement
includes the phrase KEY EQUAL TO the-key, in which the-key is either the relative key
data item (for files with relative organization) or the prime record key data item (for files with
indexed organization).
• 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.
START 455










