COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Figure 2 Directly Contained Programs and Indirectly Contained Programs
Scope of User-Defined Names
When a program directly or indirectly contains other programs, each program can use identical
user-defined names to name objects independent of the use of these user-defined names by other
programs. If program X describes a data item named B, and program X includes another program
Y, program Y can describe a different data item named B (or even a file connector named B). The
B of program Y is entirely separate from the B of program X. The two Bs have different scopes.
Table 8 Scope of User-Defined Names
What Can Reference ItType of User-Defined Name
Statements and entries in the program that defines itParagraph-name
Section-name
Any COBOL programLibrary-name
Text-name
Statements and entries in either the program that contains
the Configuration Section or programs that it contains
Alphabet-name
Class-name
(when the user-defined word is declared in a Configuration
Section)
Condition-name
Mnemonic-name
Symbolic character
See these topics:Program-name
Condition-name*
Program-Name
Data-name
Condition-Name, Data-Name, File-Name, and
Record-Name
File-name
Record-name
Index-name
Index-Name
* When not declared in the Configuration Section.
Program-Name
The PROGRAM-ID paragraph of a program’s Identification Division declares that program’s
program-name. Only the CALL and CANCEL statements and the END PROGRAM statement can
refer to a program-name. The program-names allocated to programs constituting a run unit are not
necessarily unique, but when two programs in a run unit are identically named, at least one of
those two programs must be directly or indirectly contained within another separately compiled
program that does not contain the other of those two programs.
Nested Source Programs 49