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

If a file opened for EXTEND is an Enscribe unstructured file, its size must be a multiple of the
record size.
Key of Reference
For a relative file, the key of reference is the relative key. For an indexed or queue file, the
key of reference is the prime record key.
Locked System Files
An HP COBOL program cannot open a system file that it closed and locked earlier in its current
execution.
Opening a File Multiple Times, Simultaneously
An HP COBOL program can open one system file under more than one COBOL file name.
This is particularly helpful when you are developing a server. You can open $RECEIVE
twice—once for INPUT and once for OUTPUT—and use TACL ASSIGN commands to make
one terminal (or obey file) your input simulator and another terminal your output monitor.
If an HP COBOL program opens a file with a certain COBOL file name, it must close that
COBOL file (using that COBOL file name) before it can open it again with that COBOL file
name.
Operations by Other Input-Output Statements
Before any other input-output statement can operate upon a file, an OPEN statement must
make the file accessible.
Whether you can use a verb to operate on a file depends on the mode in which you open
the file (INPUT, OUTPUT, I-O, or EXTEND), the file’s organization and access mode, and the
device with which the file is associated.
The READ, WRITE, REWRITE, START, and DELETE statements can operate only on files opened
with certain options. Table 63 summarizes the open modes that make files having different
organizations and access modes accessible to these statements.
The START and DELETE statements can operate only on files associated with disk devices.
The REWRITE statement can operate only on files associated with disk devices.
The CLOSE, LOCKFILE, UNLOCKFILE, and UNLOCKRECORD statements can operate on any
open file.
Direct Calls to NonStop Operating System I-O Procedures
If you open a file with the OPEN statement, do not perform I-O operations on that file by
making direct calls to NonStop operating system I-O procedures. If you do, the results are
undefined.
Table 63 I-O Statements You Can Use in Different Open Modes
Open Mode
EXTENDI-OOUTPUTINPUTI-O Statement
ALLALLREAD
ALLWRITE Org: S, R, IOrg: R, I
Acc: SAcc: R, D
ALLREWRITE
START Org: S*, R, IOrg: S*, R, I
Acc: S, DAcc: S, D
Org: R, IDELETE
I = Indexed or queueOrg is the file’s organization:
382 Procedure Division Verbs