Function
The GLOBAL clause can only be used within a nested program. It defines a file-name (data-name or report-name; see section "Data description entry" and chapter "Report Writer" for details) as global. A global name can be accessed by the program defining it and by any other program contained directly or indirectly in that program.
Format
IS GLOBAL
Syntax rules
The GLOBAL clause may only be specified in file description entries.
The GLOBAL clause must not be specified in file or record description entries for files that use a common I-O area (SAME RECORD AREA clause).
The GLOBAL clause may only be specified in a method definition.
General rules
A data-name, file-name or report-name whose description contains a GLOBAL clause is a global name. All data-names subordinate to a global name and all condition-names associated with a global name are global names.
Any program contained in the program that describes the global name may access a global name. The global name does not need to be described again in the program that references it. In the case of references to identical names, the local names have priority (see “Determining the valid name” in "Local and global names").
If both the LINAGE and GLOBAL clauses are specified in a description of a sequential file, then the LINAGE-COUNTER special register is also global.