ILE COBOL Language Reference


EXTERNAL Clause

The EXTERNAL clause specifies that the storage associated with a data item is associated with the run unit rather than with any particular program within the run unit.

EXTERNAL Clause - Format
 
>>-+----+--EXTERNAL--------------------------------------------><
   '-IS-'
 
 

An external data item can be referenced by any program in the run unit that describes the data item. References to an external data item from different programs using separate descriptions of the data item are always to the same data item. In a run unit, there is only one representation of an external data item.

The EXTERNAL clause can be specified in either 01 level entries in the Working-Storage Section or in file description entries. If there are two data description entries with the same data name in the same Data Division, only one entry can contain the EXTERNAL clause. Index-names, condition-names, and renaming (level-66) items in an external data record do not possess the EXTERNAL attribute.

The data contained in the record named by the data-name clause is external and can be accessed and processed by any program in the run unit that describes and, optionally, redefines it. This data is subject to the following rules:

See Data Reference and Name Scoping for more information.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]