In addition to identifying a resource, a name can have global or local attributes. Some names are always global, some names are always local, and some names are either local or global depending on specifications in the program in which the names are declared.
Use the GLOBAL clause in the data description entry to indicate that a name is global. For more information about using the GLOBAL clause, see GLOBAL clause.
A local name can be used only to refer to the resource with which it is associated from within the program in which the local name is declared.
By default, if a data-name, a file-name, a record-name, or a condition-name declaration in a data description entry does not include the GLOBAL clause, the name is local.
Restriction: Specific rules sometimes prohibit specifying the GLOBAL clause for certain data description, file description, or record description entries.
The following list indicates the names that you can use and whether the name can be local or global:
A data-name is global if the GLOBAL clause is specified either in the data description entry that declares the data-name or in another entry to which that data description entry is subordinate.
A file-name is global if the GLOBAL clause is specified in the file description entry for that file-name.
A record-name is global if the GLOBAL clause is specified in the record description that declares the record-name, or in the case of record description entries in the file section, if the GLOBAL clause is specified in the file description entry for the file name associated with the record description entry.
A condition-name that is declared in a data description entry is global if that entry is subordinate to another entry that specifies the GLOBAL clause.
A condition-name that is declared within the configuration section is always global.
A program-name is neither local nor global. For more information, see Conventions for program-names.
A section-name is always local.
A paragraph-name is always local.
An alphabet-name is always global.
A class-name is always global.
A mnemonic-name is always global.
A symbolic-character is always global.
If a data item that possesses the global attribute includes a table accessed with an index, that index also possesses the global attribute. In addition, the scope of that index-name is identical to the scope of the data-name that includes the table.