COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Usage Considerations:
• Sharing a File Connector
If more than one of the source programs compiled into a run unit contain file description entries
defining the same file name, all entries that include the EXTERNAL clause describe the same
external file connector.
Any file name whose file description entry does not include the EXTERNAL clause refers to an
internal file connector, even if the same file name identifies an external file connector in some
other program of the run unit.
• 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.
160 Data Division










