ENFORM User's Guide

Selecting Information
Developing an ENFORM Query
058058 Tandem Computers Incorporated 3–29
Using a FIND file as an intermediate file is useful when your data base contains
unnormalized data. For example, suppose the following record description describes
record occurrences stored in your data base:
RECORD alias.
FILE IS "$mkt.sample.alias" RELATIVE.
02 name PIC X(20).
02 synonym PIC X(10) OCCURS 3 TIMES.
END
The OCCURS clause causes the data stored for this record description to be
unnormalized. When subscripts (synonym [1], synonym [2],...) are used, ENFORM
obtains the data and prints it in three columns. If you want the data to appear in one
column, include a FIND file record description that associates one instance of the
nonrepeating field (in this case: name) with each instance of the repeating group (in
this case: synonym). For example:
RECORD interim.
FILE IS "$mkt.sample.normal" UNSTRUCTURED.
02 name1 PIC X(20).
02 synonym1 PIC X(10).
02 name2 PIC X(20).
02 synonym2 PIC X(10).
02 name3 PIC X(20).
02 synonym3 PIC X(10).
END
After including the record description in the dictionary, issue a FIND statement to
store the data in the FIND file. For example:
FIND interim
(name1:= name,
synonym1 := synonym [1],
name2 := name,
synonym2 := synonym [2],
name3 := name,
synonym3 := synonym [3] );
Once the FIND statement is issued, add another record description to the dictionary
that in effect breaks down each record in the FIND file so that the data appears
normalized. For example:
RECORD normal.
FILE IS "$mkt.sample.normal" UNSTRUCTURED.
02 name PIC X(20).
02 synonym PIC X(10).
END
Notice that the same physical file is specified for both interim and normal. Specifying
more than one record description for the same physical file allows a different view of
the data. Associating more than one record description with the same physical file is
only possible for unstructured file types.