COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
◦ A DEFINE of the class MAP, SPOOL, or TAPE (see DEFINEs (page 593))
◦ The COBOL_ASSIGN_ routine (see COBOL_ASSIGN_ (page 646))
• Devices That You Can Open
The OPEN statement can open devices that accept normal read and write operations (as
opposed to read and write operations that require special control information). This table
shows which file organizations are compatible with which devices:
Device Type NumbersDevices AllowedFile Organization
3Disk fileRelative, indexed, or queue
Sequential without LINAGE 0Process
2$RECEIVE
3Disk file
4Tape
5Printer
6Page mode terminal
7Envoy line
8Card reade
9X25 treated as a process
50COMM system manager
Sequential with LINAGE 0Process
5Printer
• Successful and Unsuccessful Open Operation
Execution of an OPEN statement sets an I-O status code for each file specified in the statement.
Successful opening of a file sets the I-O status code of that file to “00,” “05,” “07,” or “97.”
Unsuccessful opening of a file sets the I-O status code to one of the values in Table 62 and
causes execution of any applicable USE AFTER EXCEPTION CONDITION procedure.
If you declared a file-status data item for a file (see FILE-CONTROL Paragraph (page 115)), the
process stores the I-O status code in that data item. For an extensive discussion of I-O status
codes, see I-O Status Code (page 247).
Table 62 I-O Status Codes for Unsuccessful Open Operations
Unsuccessful Open OperationI-O Status
Code
One of:“30”
◦ The file was to be opened for OUTPUT and an existing disk file with unsuitable attributes
cannot be purged.
◦ The file was to be opened for OUTPUT and the data in an existing disk file cannot be purged.
◦ The file was to be opened for EXTEND and the file cannot be positioned at its end.
◦ The open operation failed due to some cause outside COBOL.
The file was to be opened for INPUT, I-O, or EXTEND; the file is not optional; and the file does
not exist.
“35”
One of:“37”
◦ The file was to be opened for INPUT, but the device is not suitable for INPUT.
◦ The file was to be opened for OUTPUT, but the device is not suitable for OUTPUT.
◦ The file was to be opened for I-O, but the device is not suitable for I-O (both input and output).
Only disks and terminals can be opened for I-O.
380 Procedure Division Verbs










