ILE COBOL Language Reference

Conventions for Program-Names

The program-name of a program is specified in the PROGRAM-ID paragraph of the program's Identification Division. A program-name can be referenced only by the:

Names of 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 which does not contain the other of those two programs.

The following rules regulate the scope of a program-name.

Related Information:

Rules Regulating the Scope of Program Names

The following rules apply to referencing a program-name of a program that is contained within another program. For this discussion, we will say that Program-A directly contains Program-B and Program-C, Program-C directly contains Program-D and Program-F, and Program-D directly contains Program-E.



Rules Regulating the Scope of Program Names

If Program-D does not possess the COMMON attribute, then Program-D can only be referenced by the program that directly contains Program-D, that is, Program-C.

If Program-D does possess the COMMON attribute, then Program-D can be referenced by Program-C since it contains Program-D, and by any programs contained in Program-C except for Program-D and programs contained in Program-D. In other words, if Program-D possesses the COMMON attribute, Program-D can be referenced in Program-C and Program-F, but not by statements in Program-E, Program-A, Program-B, or Program-D.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]