COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Table 62 I-O Status Codes for Unsuccessful Open Operations (continued)
Unsuccessful Open OperationI-O Status
Code
The file is locked.“38”
The attributes of the file under the file system do not correspond to the attributes specified for the
file in the program, for example:
“39”
◦ The file was to be opened for INPUT but it is assigned to a printer device.
◦ The file description includes a LINAGE clause, but the file is assigned to a tape drive.
◦ The file description includes a MULTIPLE FILE TAPE clause, but the file is not assigned to a
tape drive.
◦ The file is described as having keys, but the file is assigned to a nondisk file.
◦ The prime record key attributes of a disk file are inconsistent with the description for the
COBOL file.
◦ The alternate record key attributes of a disk file are inconsistent with the description for the
COBOL file.
The program already has that file open, or the file is one of several on a tape reel and another
of the files on the reel is open.
“41”
The file is an EDIT format, unstructured disk file and the call to the operating system routine that
reads EDIT files failed. The open operation cannot allocate a resource required to process the
file.
“91”
• Labeled Files
When the LABEL RECORDS clause in the file description entry indicates that label records are
present, the beginning file or reel labels are processed in accordance with the conventions
for the specified open mode. If the file is opened for INPUT or EXTEND, the label records are
verified. If the file is opened for OUTPUT, the label records are created. If the device assigned
is not a tape, the LABEL RECORDS clause is ignored.
• File Position Indicator
The file position indicator specifies the next record to be accessed within the opened file during
certain sequences of input-output operations. For files opened for INPUT or I-O, it is defined
to be just before the first record in the file. For files opened for OUTPUT or EXTEND, it is
undefined.
When a file is opened for OUTPUT, run-time routines position the file at its beginning point.
The first WRITE statement executed for the file creates the first logical record in the file.
When a file is opened for EXTEND, run-time routines position the file to point immediately
following the last existing logical record, which is defined:
Last Existing RecordFile Organization
Last record written to the fileSequential
Existing record with highest relative record numberRelative
Existing record with highest prime record key valueIndexed or queue
If a file opened for EXTEND is empty, the first WRITE statement executed for the file creates
the first logical record. If the file is not empty, the first WRITE statement executed for the file
creates the successor record to the current last record.
OPEN 381










