The GLOBAL clause specifies that a data-name or constant-name is available to the program that declares it and to every program contained within the program that declares it, as long as the contained program does not itself have a declaration for that name. All data-names subordinate to, or condition-names or index-names associated with a global name, are global names.
GLOBAL Clause - Format >>-+----+--GLOBAL---------------------------------------------->< '-IS-'
A data-name is global if the GLOBAL clause is specified either in the data description entry by which the data-name is declared or in another entry to which that data description entry is subordinate.
+-------------------------------IBM Extension--------------------------------+
The GLOBAL clause can be specified in the Linkage and Local-Storage Sections, but only in data description entries whose level-number is 01.
+----------------------------End of IBM Extension----------------------------+
In the same Data Division, the data description entries for any two data items for which the same data-name is specified must not include the GLOBAL clause.
A statement in a program contained directly or indirectly within a program which describes a global name can reference that name without describing it again.
+-------------------------------IBM Extension--------------------------------+
If the TYPEDEF clause is specified with the GLOBAL clause, the scope of the GLOBAL clause applies to the type-name, and to any data items subordinate to the type-name. The GLOBAL attribute is not acquired by a data item that is defines using a global type-name within a TYPE clause.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.