COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Exclusion Mode
In HP COBOL, you specify a file’s exclusion mode when you open it (see OPEN (page 375)).
Table 19 Exclusion Modes
Other Processes Can Write to FileOther Processes Can Read FileMode
YesYesShared
NoYesProtected
NoNoExclusive
File Connector
A COBOL program makes reference to files indirectly. It does not refer to a file by the file’s Guardian
file name. Instead, it uses an ASSIGN clause in a file-control entry in the Input-Output Section of
the Environment Division (possibly overridden at execution time by command interpreter commands)
to associate the Guardian file name with a file connector, which is referred to throughout the
remainder of the COBOL program through a COBOL file name.
The file connector is an entity that exists at execution time and contains information about the file,
such as its open mode, position, and so on. A file connector can be internal or external to a given
COBOL program. Unless a file connector is explicitly described as external, it is internal.
An internal file connector is associated with and only accessible to the specific program that
describes it or to programs contained within that program. An external file connector is associated
with the run unit and accessible to every program in the run unit that describes the file connector.
The execution of an OPEN statement associates a physical file with a file connector. HP COBOL
permits the simultaneous association of one physical file with more than one file connector in a
run unit in certain cases.
The execution of a CLOSE statement dissociates a physical file from a file connector.
In this manual, “file” is often used as an abbreviation for “file connector” and “file name” as an
abbreviation for “file referenced by file name.” The context determines the meaning in these cases.
File Position Indicator
The file position indicator is a conceptual component of a file connector, and its setting is a dynamic
attribute of the connector. During sequential record retrieval operations, the setting of the file
position indicator determines precisely which record is the next one to be accessed.
Normally, the setting reflects:
• A record number for a sequential or line sequential file
• A relative record number for a relative file
• A prime record key value for an indexed or queue file
• An alternate record key value for a file with any organization
Sometimes its setting indicates that:
• The at-end condition exists (due to a prior unsuccessful execution of a READ statement for the
file).
• No valid next record has been established.
• An optional file is not present.
The setting of the file position indicator is irrelevant when the open mode is Output or Extend or
the access mode is Random, because no sequential record retrieval operations are permitted in
these cases.
84 Data Fundamentals










