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

2. When the file does not contain a qualifying record, the invalid-key condition exists and
the start operation terminates with the I-O status code “23.” When the search operation
succeeds, the file position indicator is set to the value of the key of reference for the record
found.
The execution of the START statement does not alter the contents of the record area
associated with file-name or the content of the depending item specified in the
DEPENDING phrase of the RECORD clause that describes file-name.
NOTE: Use care in specifying the starting record. When you are starting a file with
APPROXIMATE positioning (which is the default), the value you use for wait-time must
take into account that a START can take somewhat longer than expected. This can occur
when the START leads to a nonexistent record, because the file system searches through
the file looking for the next defined record before reporting the absence of the record
sought.
Suppose that your file contains alternate keys that can have duplicates, and one such
alternate key is DEPT-NUM. If you want to start at the department whose number follows
5440, it is more efficient to use a START of the form
MOVE "5441" TO DEPT-NUM.
START MYFILE KEY IS NOT LESS THAN DEPT-NUM.
than it is to use
MOVE "5440" TO DEPT-NUM.
START MYFILE KEY IS GREATER THAN DEPT-NUM.
because the latter form causes the file system to sequentially read each record having
the key value “5440” until it finds a record whose key exceeds 5440. The time saved
depends upon the number of duplicates in the file.
See the Guardian Programmer’s Guide for more information on the action of READ (which
is called by the START logic).
File-Status Data Item
If file-name has an associated file-status data item, execution of the START statement always
assigns an appropriate I-O status code to it. The value “00” reports an unconditionally
successful start operation. The value “97” reports a successful start operation that validated
a position by reading a locked record.
The values of the I-O status data item for unsuccessful start operations are:
Unsuccessful Start OperationI-O Status Code
The file position indicator indicates that an optional input file is not present, the invalid-key
condition exists, and the start operation terminates.
“23”
Either the time specified in the TIME LIMIT phrase elapsed before the start operation completed
(indicated by the special register GUARDIAN-ERR having the value “40”), or the start operation
“30”
failed for some non-COBOL reason. In either case, the value of the file position indicator becomes
undefined.
The file identified by file-name is not open for INPUT or for I-O. The start operation terminates.“47”
The program attempted to use the TIME LIMIT phrase when the associated OPEN statement does
not specify TIME LIMITS.
“90”
The program attempted to use the POSITION phrase when the file has insertion-ordered alternate
keys. The start operation fails.
“91”
454 Procedure Division Verbs