The rules for qualifying a name are:
- A name can be qualified even though it does not need qualification.
- Each qualifier must be of a higher level than the name it qualifies, and must be within the same hierarchy.
For example:
01 FIELD-A
02 FIELD-B
05 SUB1
07 SUB2
02 FIELD-C
07 SUB1
A hierarchy includes all subordinate entries to the next equal or higher level-number. Therefore, in the above example all entries are in the hierarchy of FIELD-A. All entries from FIELD-B to, but not including, FIELD-C are in the hierarchy of FIELD-B.
In the hierarchy of FIELD-A, SUB1 can be used twice; once as subordinate to FIELD-B and once as subordinate to FIELD-C. In references to SUB-1, it must be qualified as SUB-1 OF FIELD-B or SUB-1 OF FIELD-C. Within FIELD-B or FIELD-C, SUB1 cannot be subordinate to itself.
- The complete list of qualifiers for one data-name must not be the same as a partial list of qualifiers for another.
- If a data-name or a condition-name is assigned to more than one data item, it must be qualified each time it is referred to (for the one exception, see REDEFINES Clause).
- If reference can be made unique by qualification, data-names may be defined in more than one place in a given program or compilation unit.
- If there is more than one combination of qualifiers that ensures uniqueness, then any of these combinations can be used.
- If referenced in the program, a section-name must be unique.
- If referenced in the program, a paragraph-name must be unique within a section. When a paragraph-name is qualified by a section-name, the word SECTION must not appear. A paragraph-name need not be qualified when referred to within the section in which it appears.
- LINAGE-COUNTER must be qualified each time it is referenced if more than one file description entry containing a LINAGE clause has been specified in the source program.
- Library-name must be unique in the system. Therefore, the first 10 characters of library-name must be unique.
- Text-name (member-name) can be qualified by the library-name and file-name in which it resides. (A hyphen is required between library-name and file-name, without any intervening spaces.) If no library is specified, the library list is searched. If no file-name is specified, QCBLLESRC is used.
IBM Extension
File-name is optional for the COPY statement, Format 1. If file-name is not specified, the default is QCBLLESRC.
End of IBM Extension