Enform Plus Reference Manual

Statements
Enform Plus Reference Manual422684-001
4-25
LINK Statement
LINK Statement
The LINK statement allows you to specify a connecting relationship between dictionary
record descriptions. The syntax of the LINK statement is:
record-name1 and record-name2
are the names of dictionary record descriptions containing a common field.
field-name
is the name of a field common to both of the record descriptions.
qualified-field-name1 and qualified-field-name2
are the names of fields uniquely identified as components of the record descriptions
being linked.
OPTIONAL
indicates that Enform Plus is to build logical records for the link by including all of
the records from the data file whose record description is specified on the left side of
the LINK OPTIONAL statement. Enform Plus includes each record from this data
file even when no matching record is found in the data file whose record description
is specified on the right side of the LINK OPTIONAL statement.
Both the LINK statement and the LINK OPTIONAL statement establish a connecting
relationship, called a link. (You can also establish a link with a WHERE clause.) A link
allows you to view your data in a new manner. When you specify either statement,
Enform Plus establishes a new logical record description that consists of fields from
both linked record descriptions. Enform Plus then builds a set of logical records for the
new logical record description.
Enform Plus builds the set of logical records by selecting records from each of the data
files associated with the linked record descriptions. When you use either statement, you
must identify a field (called a linking field) from each record description. Enform Plus
uses the data value of these linking fields to determine which records from each data file
become part of the set of logical records. Enform Plus then uses the set of logical
records to build the target records from which your Enform Plus output is produced. If
you include a nonlinking WHERE clause (see the WHERE Clause
on page 5-72 for a
definition of nonlinking WHERE clauses) in a query, such as:
WHERE empnum GT 100
the target records include information only from those logical records that satisfy the
restriction specified in the WHERE clause.
{ record-name1 [ TO ] [ OPTIONAL ] record-name2 }
{ VIA field-name }
LINK { } ,...[ ; ]
{ qualified-field-name1 [ TO ] [ OPTIONAL ] }
{ qualified-field-name2 }