Enform Plus Reference Manual
Enform Plus Language Elements
Enform Plus Reference Manual—422684-001
3-7
Primary Key References
field-name OF record-name
or
field-name OF group-name
A field name requires as much qualifying as necessary to uniquely identify the field to
Enform Plus. The necessary qualification might be as simple as combining the field
name with the record name or group name. It might require combining the field name
with both a group name and a record name or with two group names. Consider the
record descriptions shown in Figure 3-2.
If both the stock-items and shelf-items record descriptions are open, ink
must be qualified. To qualify ink within shelf-items, one of the following must be
entered:
ink OF erasers OF shelf-items
shelf-items.erasers.ink
Primary Key References
The records in database files can be uniquely identified by the value of a primary key.
For database files with key-sequenced file structure, the primary key is part of the
record. For database files with relative, unstructured, or entry-sequenced file structure,
the primary key is not part of the record. Primary keys can be referenced in two forms:
KEY OF record-name
or
record-name.KEY
The form record-name.KEY can appear for only one relative, entry-sequenced, or
unstructured file per query.
The primary key for files with key-sequenced file structure is a field within the record.
For key-sequenced files, referencing the primary key using the form record-
name.KEY is the same as explicitly naming the field described as the primary key. The
Figure 3-2. Records With Duplicate Field Names
RECORD stock-items. RECORD shelf-items.
FILE IS "stock" KEY-SEQUENCED. FILE is "shelf" KEY-SEQUENCED.
02 depot-num PIC 99. 02 dept-num PIC 99.
02 cont-num PIC 99. 02 dept-name PIC X(10).
02 erasers. 02 cont-num PIC 99.
05 ink PIC 99. 02 pens.
05 gum PIC 99. 05 b-point PIC 99.
05 pink PIC 99. 05 felt-tip PIC 99.
02 ink-pens. 02 erasers.
05 felt-tip PIC 99. 05 ink PIC 99.
05 b-point PIC 99. 05 gum PIC 99.
05 fountain PIC 99. 05 gray PIC 99.