ENFORM User's Guide

Connecting Record Descriptions to Form New Relationships
Developing an ENFORM Query
058058 Tandem Computers Incorporated 3–7
For example, if you have a terminal that does not have a scrolling mechanism, you
might want to control the number of lines of information that ENFORM displays on
your terminal at any one time. To do this, set the value of the @DISPLAY-COUNT
option variable to 24:
SET @DISPLAY-COUNT TO 24;
When you set @DISPLAY-COUNT to 24, ENFORM displays a maximum of 24 lines of
information. To indicate that you are ready for the next 24 lines of information, press
the terminal RETURN key.
As another example, consider resetting the left-hand margin that ENFORM uses when
producing a report. To do this, set the value of the @MARGIN option variable to the
column in which you want the report to begin printing. If you want ENFORM to
begin printing in column 5, set @MARGIN to 5:
SET @MARGIN TO 5;
Refer to Section 5 for other examples that demonstrate the advantages of resetting the
option variables.
Connecting Record
Descriptions to Form
New Relationships
ENFORM allows you to connect two or more record descriptions in a relationship that
establishes a new logical record description. The process of establishing a connecting
relationship is called linking. During the linking process, ENFORM links the
dictionary record descriptions of the records and builds logical record occurrences
composed of record occurrences from both record descriptions.
The number of target records (the data base information retrieved by the query
processor) resulting from a query where record descriptions are linked depends on the
data values in the linking fields. The number of target records ranges from a
minimum value of zero to a maximum value that is the product of the number of
record occurrences associated with each record description.
The minimum number of resulting target records occurs when no data value of the
linking field in the first record description is found in the linking field of the second
record description.
The maximum number of resulting target records occurs when the linking field has the
same value in every record occurrence for both record descriptions. In some cases,
specifying a link that returns the maximum number of target records causes
unexpected results. For example, suppose that 1000 record occurrences are associated
with a-rec and 3000 record occurrences are associated with b-rec. Suppose also that the
linking field (link-field) in all the record occurrences contains the value SAME STRING.
If the following query is issued:
OPEN a-rec,b-rec;
LINK a-rec TO b-rec VIA link-field;
LIST a-rec,b-rec;