COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-12
File Description Entries
EXTERNAL Clause Inherited by Data Items in External Files
The EXTERNAL clause specifies that the file connector associated with the file
name defined by the containing file description entry is an external file connector,
and that the data items associated with all of the record descriptions for this file
name are external data items; therefore, any other source program compiled into
the same run unit can share these resources by including a file description entry
that defines the same file name and contains the EXTERNAL clause.
Other Related Data Items Required to be External
Any data items referenced in the clauses of a file description entry containing the
EXTERNAL clause (such as the LINAGE clause or the VARYING DEPENDING
clause) or in the clauses of the corresponding file-control entry (such as the FILE
STATUS clause or the ALTERNATE RECORD KEY clause) must be external data
items.
Consistency of External Files Throughout the Run Unit
All descriptions of the same external file connector, and the file that it references,
must be functionally identical. The detailed restrictions are:
°
File-control entries
All of the file-control entries must specify or imply the same operating system
file name, organization, and access mode. If any of the file-control entries
includes the OPTIONAL phrase, all of them must do so.
°
Keys
If any of the file-control entries specifies a relative key, record key, or alternate
record key, all of them must specify the same external data item for that
purpose. Each alternate record key must have a consistent DUPLICATES
attribute.
°
PADDING CHARACTER clause
If any of the file-control entries includes a PADDING CHARACTER clause, all
of them must include a PADDING CHARACTER clause that specifies the same
padding attribute. In particular, when the value of a data item supplies the
padding character, the same external data item must be specified for this
purpose in each of the clauses.
°
RECORD DELIMITER clause
If any of the file-control entries includes a RECORD DELIMITER clause
specifying a system-name, all of them must include a RECORD DELIMITER
clause specifying the same system-name.
°
BLOCK CONTAINS clause
If any of the file description entries includes a BLOCK CONTAINS clause, all of
them must include a BLOCK CONTAINS clause that specifies the same block
size attribute.