Accessible data items usually require that certain representations of data be stored. File connectors usually require that certain information concerning files be stored. The storage associated with a data item or a file connector may be external or internal to the program in which the object is declared.
A data item or file connector is external if the storage associated with that object is associated with the run unit rather than with any particular program within the run unit. An external object may be referenced by any program in the run unit which describes the object. References to an external object from different programs using separate descriptions of the object with the same name are always to the same object. In a run unit, there is only one representative of an external object.
An object is internal if the storage associated with that object is associated only with the program which describes the object.
External and internal objects may have either global or local names.
A data record described in the Working-Storage Section is given the external attribute by the presence of the EXTERNAL clause in its data description entry. Any data item described by a data description entry subordinate to an entry describing an external record is also given the external attribute. If a record or data item does not have the external attribute, it is part of the internal data of the program in which it is described.
A file connector is given the external attribute by the presence of the EXTERNAL clause in the associated file description entry. If the file connector does not have the external attribute, it is internal to the program in which the associated file-name is described. The EXTERNAL clause cannot be specified for sort-merge files.
The data records described subordinate to a file description entry which does not contain the EXTERNAL clause, or those subordinate to a sort-merge file description entry, as well as any data items described subordinate to the data description entries for such records, are always internal to the program describing the file-name. If the EXTERNAL clause is included in the file description entry, the data records and the data items are given the external attribute.
Data records and subordinate data items described in the Linkage Section of a program are always considered to be internal to the program describing that data. Special considerations apply to data described in the Linkage Section whereby an association is made between the data records described and other data items accessible to other programs.