COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-155
OPEN
Exclusion Modes
The EXCLUSIVE, SHARED, or PROTECTED phrase specifies the appropriate file
system exclusion mode for the file.
If the OPEN statement does not have one of these phrases, the process
determines the default exclusion mode: when a command interpreter ASSIGN
command that applies to the file specifies an exclusion mode, the process uses
that exclusion mode; otherwise, the process determines the exclusion mode from
the type of file device:
A file that no process has open can be opened by any single process with any
exclusion mode.
If some process already has a file open EXCLUSIVE, no other process can open
the file.
A file intended for multi-user access must specify SHARED.
If some process already has a file open SHARED for any access mode except
OUTPUT, another process can open the same file SHARED for any access mode.
If some process already has a file open SHARED for OUTPUT, no other process
can open the file (because the OPEN would delete all the records in the file).
If some process already has a file open SHARED for INPUT access mode, another
process can open the same file PROTECTED for any access mode.
If some process already has a file open PROTECTED for INPUT access mode,
another process can also open the same file PROTECTED for INPUT access
mode.
All other combinations of access mode and exclusion mode cause the open
operation to fail.
Device Exclusion Mode
Terminal (including the operator console) SHARED
Disk file being opened for input PROTECTED
Other file EXCLUSIVE