Scope of Names

When source elements are directly or indirectly contained within other source elements, each source element can use identical user-defined words to name items independent of the use of these user-defined words by other elements. (See the discussion of user-defined words in the section COBOL Words.) When identically named items exist, a source elements's reference to such a name, even when it is a different type of user-defined word, is to the item which that source element describes rather than to the item possessing the same name, described in another source element.

Delegate-names, enum-names and valuetype-names are special cases of class-names for object orientation.

The following types of user-defined words can be referenced only by statements and entries in the source element in which the user-defined word is declared:

The following types of user-defined words can be referenced throughout a compilation group:

The following types of names, when declared in a Configuration Section, can be referenced only by statements and entries either in the source element that contains that Configuration Section or in any source element contained within that source element:

Specific conventions, for declarations and references, apply to the following types of user-defined words when the conditions listed above do not apply: