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

Procedure Division Verbs
HP COBOL Manual for TNS/E Programs520347-003
9-231
START
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.
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:
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).
I-O Status Code Unsuccessful Start Operation (page 1 of 2)
“23” The file position indicator indicates that an optional input file is not
present, the invalid-key condition exists, and the start operation
terminates.
“30” 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
failed for some non-COBOL reason. In either case, the value of
the file position indicator becomes undefined.
“47” The file identified by file-name is not open for INPUT or for
I-O. The start operation terminates.