When condition-names, data-names, file-names, record-names and report-names
and typedef-names
are declared in a source element, they can be referenced only by that source element unless one or more of the names is global and the source element contains other source elements.
The requirements governing the uniqueness of the names declared by a single source element to be condition-names, data-names, file-names, record-names and report-names
and typedef-names
are explained in the discussion of user-defined words in the section COBOL Words.
A source element cannot reference any condition-name, data-name, file-name, record-name or report-name
or typedef-name
declared in any source element it contains.
A global name can be referenced in the source element in which it is declared or in any source elements which are directly or indirectly contained within that source element.
When a source element, source element B, is directly contained within another source element, source element A, both source elements can define a condition-name, a data-name, a file-name, a record-name or a report-name
or a typedef-name
using the same user-defined word. When such a duplicate-name is referenced in source element B, the following rules are used to determine the referenced item: