contents.gifindex.gifprev1.gifnext1.gif

7.2.3 Summary of Dictionary Fields

Fields defined with an OCCURS clause are assigned unique sequential names. Fields without names are disregarded. When multiple fields occupy the same area, the compiler chooses only one of them unless you have a WHEN directive to distinguish them. To choose:

odb90000.gif The compiler preserves fields mentioned in KEY IS phrases.

odb90000.gif It discards group items unless USE GROUP is specified.

odb90000.gif It discards REDEFINES.

odb90000.gif It uses the largest record if there are multiple record definitions.

Identical field names

In COBOL you distinguish fields with identical names by qualification. For example, there are two fields named RATE in the following code, but they can be qualified by their group items. Thus, you would reference RATE OF TERMS-CODE and RATE OF AR-CODE in your program:

01 record-area.
 03 terms-code.
  05 rate   	pic s9v999.
  05 days   	pic 9(3).
  05 descript  	pic x(15).
 03 ar-code.
  05 rate   	pic s9v999.
  05 days   	pic 9(3).
  05 descript  	pic x(15).

However, database systems consider duplicate names an error. Thus, if more than one field in a particular file has the same name, the data dictionary will not be generated for that file.

The solution to this situation is to add a NAME directive that associates an alternate name with one or both of the conflicting fields.