Qualification

Every user-defined name explicitly referenced in a COBOL program must be uniquely defined in one of these ways:

  1. No other name has the same spelling and hyphenation.
  2. The name is unique within the context of a REDEFINES clause.
  3. The name exists within a hierarchy of names, and reference to the name can be made unique by mentioning one or more of the higher level names in the hierarchy.

These higher-level names are called qualifiers. Identical user-defined names may appear in a source program; however, uniqueness must then be established through qualification for each user-defined name explicitly referenced. All available qualifiers need not be referenced as long as uniqueness is established.

General Format

Format 1
{data-name-1} { {OF} name-2 } ... [ {OF} file-name ]
{cond-name  }   {IN}                {IN}

Format 2

{data-name-1} {OF} file-name
{cond-name  } {IN}
Format 3
paragraph-name {OF} section-name
               {IN}

Format 4

lib-name {OF} dir-name
         {IN}

Format 5

LINAGE-COUNTER {OF} file-name
               {IN}

Syntax Rules

  1. For each non-unique user-defined name that is explicitly referenced, uniqueness must be established through a sequence of qualifiers that precludes any ambiguity.
  2. A name may be qualified even though it does not need qualification.
  3. IN and OF are equivalent.
  4. In Format 1, each qualifier must be the name associated with a group item to which the item being qualified is subordinate, or the name of a condition-variable with which the condition-name being qualified is associated. Qualifiers are specified in the order of successively more inclusive levels in the hierarchy.
  5. If the program contains explicit references to a paragraph-name, the paragraph-name cannot appear more than once in the same section. A paragraph-name need not be qualified in a reference from within the same section that contains paragraph-name.
  6. The LINAGE phrase of a file's FD creates an implicit data item called LINAGE-COUNTER. If more than one file in a program contains a LINAGE phrase, then reference to a file's LINAGE-COUNTER must be qualified by the name of the file.
  7. If both qualification and subscripting are used in a data reference, the qualification is done first.
  8. If both qualification and reference modification are used in a data reference, the qualification is done first.
  9. A Format 4 form of qualification is used with the COPY statement. It is described in that section.