Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

GLOBAL clause

Function

The GLOBAL clause can only be used within a nested program. It defines a file-name, data-name or report-name as global. A global name can be accessed by the program defining it and by any other program contained directly or indirectly in this program.

Format


IS GLOBAL


Syntax rules

  1. The GLOBAL clause may only be specified in entries with level number 01:

    • for data description entries in the WORKING-STORAGE or FILE SECTION.

    • for type description entries in the WORKING-STORAGE, LOCAL-STORAGE, LINKAGE or FILE SECTION.

  2. If two data items are defined in the same Data Division with the same name, the GLOBAL clause must not be specified in any of the corresponding data description entries.

  3. The GLOBAL clause may not be specified in a method, factory or object definition.

General rules

  1. A data-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.

  2. 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").

  3. If a data description entry also contains the REDEFINES clause in addition to the GLOBAL clause, the redefined data item is not necessarily global by implication.

  4. If a global data item contains a variable-length table, then the corresponding DEPENDING ON element in the same Data Division must also be described as global.

  5. The data-names in the CONFIGURATION SECTION are always implicitly global.

  6. The index of an indexed table assigned to a global data item is also global.