Enform Plus Reference Manual

Links and the LINK OPTIONAL Statement Rules
Enform Plus Reference Manual422684-001
C-6
Review of Rules for the LINK OPTIONAL Statement
Under the transitive property of links, apple is linked optionally to orange, banana,
and pear. The orange, banana, and pear are linked to each other. These links
could be symbolically represented as:
apple orange
banana pear
Note that apple is linked to orange, banana, and pear; but orange, banana,
and pear are not linked to apple.
Review of Rules for the LINK OPTIONAL
Statement
Enform Plus uses the following rules to determine the validity of links when your query
specifications contain LINK OPTIONAL statements.
1. A record description on the right side of a LINK OPTIONAL statement must not be
linked back to the record description on the left side of the same LINK OPTIONAL
statement.
Enform Plus requires you to adhere to this rule because a LINK OPTIONAL
statement is a one-directional link. When you adhere to this rule, Enform Plus has a
starting place from which to begin building the logical record occurrences. If
Enform Plus did not require adherence to this rule, the starting place could be
ambiguous due to the transitive property of links.
2. A given record description must not appear on the right side of more than one LINK
OPTIONAL statement. A record description appears on the right side of more than
one LINK OPTIONAL statement when you:
Specify the same record description on the right side of two or more LINK
OPTIONAL statements.
Specify a two-directional link between record descriptions that appear on the
right sides of two separate LINK OPTIONAL statements. (Note that a two-
directional link caused by the transitive property of links is also invalid.)
Enform Plus requires adherence to this rule because the query processor cannot
support links that violate this rule.
When checking your queries for violations of these rules, Enform Plus ignores any two-
directional links that reference the same two record descriptions referenced by a LINK
OPTIONAL statement. However, after Enform Plus determines that all links are valid, it
uses all links when evaluating the rest of your query.
The following paragraphs describe links that violate these rules. These paragraphs also
describe some valid links that at first glance appear to violate these rules.