1.4.3 Resolution of Names
When a program, program B, is directly contained within another program,
program A, both programs can define a condition-name, a data-name, a
file-name, or a record-name using the same user-defined word. When such a
duplicated name is referenced in program B, the following steps determine
X the referenced resource (note, these rules also apply to classes and
X contained methods):
- The referenced resource is identified from the set of all names which
are defined in program B and all global names defined in program A and
in any programs which directly or indirectly contain program A. Using
this set of names, the normal rules for qualification and any other
rules for uniqueness of reference are applied until one or more
resource is identified.
- If only one resource is identified, it is the referenced resource.
- If more than one resource is identified, no more than one of them can
have a name local to program B. If zero or one of the resources has a
name local to program B, the following applies:
- If the name is declared in program B, the resource in program B is
the referenced resource.
- If the name is not declared in program B, the referenced resource
This rule is applied to further containing programs until a valid
resource is found.
- The resource in program A if the name is declared in program
- The resource in the containing program if the name is declared
in the program containing program A.
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
IBM Hardware |
IBM System z Redbooks
How to order publications
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Download IBM Softcopy Librarian
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.