ANS85 

The GLOBAL Clause

The GLOBAL clause specifies that a data-name, a file-name, or a report-name is a global name. A global name is available to every program contained within the program which declares it.

General Format


Syntax for General Format for the GLOBAL clause

Syntax Rules

  1. The GLOBAL clause can be specified only in data description entries whose level-number is 01 in the File Section or the Working-Storage Section, file description entries, or report description entries.

    MFCOB370 The GLOBAL clause can also be specified in the Linkage Section.

  2. 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.
  3. If the SAME RECORD AREA clause is specified for several files, the record description entries or the file description entries for these files must not include the GLOBAL clause.

General Rules

  1. A data-name, file-name or report-name described using a GLOBAL clause is a global name. All data-names subordinate to a global name are global names. All condition-names associated with a global name are global names.
  2. 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. See the topic Scope of Names in the chapter Concepts of the COBOL Language.
  3. If the GLOBAL clause is used in a data description entry which contains the REDEFINES clause, it is only the subject of that REDEFINES clause which possesses the global attribute.