COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Table 64 Open Modes for Files Assigned to Processes (continued)
ActionOpen Mode
the PROMPT phrase, is the only I-O statement that can be executed on the file; however,
prompts are ignored in this open mode.
If the process has a device subtype of 31, it is a spooler process, treated like a printer.
If the file description entry for the file includes a LINAGE clause, or the file was opened
OUTPUT or EXTEND
by the routine COBOL85^SPECIAL^OPEN or COBOL_SPECIAL_OPEN_, it is assumed
to be a printer or a spooler process. Carriage-control messages are sent to the file, and
it can have a LINAGE clause in its file description entry. WRITE, with or without the
ADVANCING phrase, is the only I-O statement that can be executed on the file. Lines of
output are held until a subsequent write or close operation, and consecutive spacing
operations due to ADVANCING clauses are consolidated to minimized output operations.
If the process does not meet the criteria stated earlier, it is assumed to be an ordinary
process. No consolidation of operations occurs, and each line is written to the process
immediately. No control information or extra blank lines are written to the process.
The file is treated as if it were a terminal. No carriage-control messages are sent to the
file, and it cannot have a LINAGE clause in its file description entry. READ and WRITE
I-O
statements can be executed on the file, but DELETE, REWRITE, and START statements
cannot.
• Files Assigned to Terminals
Any file assigned to a terminal must be described with sequential organization without alternate
keys in its file-control entry. The mode in which you open the file determines its use.
Table 65 Open Modes for Files Assigned to Terminals
ActionOpen Mode
No carriage-control messages are sent to the file, and it cannot have a LINAGE clause in
its file description entry. READ, with or without the PROMPT phrase, is the only I-O statement
that can be executed on the file; however, prompts are ignored in this open mode.
INPUT
No carriage-control messages are sent to the file, and it cannot have a LINAGE clause in
its file description entry. WRITE, with or without the ADVANCING phrase, is the only I-O
OUTPUT or EXTEND
statement that can be executed on the file; however, “ADVANCING mnemonic-name,” if
used, is ignored.
No carriage-control messages are sent to the file, and it cannot have a LINAGE clause in
its file description entry. READ and WRITE statements can be executed on the file, but
DELETE, REWRITE, and START statements cannot.
I-O
• Files Assigned to Disk Devices
When the object of an OPEN statement is a disk file, the presence or absence of such a file
on disk, as well as both the open mode and the file’s description, determines what happens.
In all cases, a disk file cannot be described with a LINAGE clause in its file description entry,
nor can a WRITE statement that operates on a disk file include an ADVANCING phrase.
• Unstructured Disk Files
Unstructured files can be used by a COBOL program in only certain instances:
◦ The program must specify sequential organization with no alternate keys.
◦ The file contains zero or more complete records. For this to be true, one of these must be
true:
– The COBOL program describes the records of the file as having an even number of
characters, and the file size is some integer multiple of the record size.
– The COBOL program describes the records of the file as having an odd number of
characters, the file system description of the file includes the “odd-unstructured”
attribute, and the file size is some integer multiple of the record size.
384 Procedure Division Verbs










