Enform Plus Reference Manual
Statements
Enform Plus Reference Manual—422684-001
4-18
Output Fields
When a FIND statement contains more than one BY, BY DESC, ASCD, or DESC clause,
Enform Plus determines a major to minor sort precedence by the order in which the BY,
BY DESC, ASCD, or DESC clauses appear in the FIND statement. The first clause has
highest priority and is sorted first, the next one second priority, down to the last clause.
Output Fields
When the FIND statement is executed, Enform Plus takes the values from the input
elements and stores them in the output field. Values are stored in the output field by
name (when the output field has the same name as an input field) or by assignment
syntax (:=). Enform Plus allows you to qualify output-field-name.
Enform Plus allows you to use subscripted output field names in a FIND statement when
the record description of the output record contains a database table; however, a
subscript range is not valid anywhere in a FIND statement. (See the description of
subscripts under Subscripts
on page 3-8 for the syntax used to include subscripts.) For
example, the following FIND statement is valid:
FIND newemp (name := emp.name,
child [ 1 ] := emp.child1,
child [ 2 ] := emp.child2,
child [ 3 ] := " ",
child [ 4 ] := " " );
The following rules apply to output-field-name:
•
The output-field-name can be qualified or subscripted.
•
The output-field-name cannot contain a subscript range.
•
If you omit output-field-name, Enform Plus operates as if it is the same as
the input field name (including any subscripts or qualifications that apply to the
input field name). Consider, for example, the following record descriptions and
FIND statements:
RECORD OLD. RECORD new.
FILE IS old KEY-SEQUENCED. FILE IS new UNSTRUCTURED.
02 A PIC XX. 02 A PIC XX.
02 B PIC 99. 02 B PIC 99.
02 C OCCURS 2 times 02 D1 PIC AA.
04 DD PIC AA. 02 D2 PIC AA.
04 EE PIC XX. 02 E1 PIC XX.
KEY 0 IS A. 02 E2 PIC XX.
END END
OPEN old, new;
FIND new (A, B, C);
The preceding FIND statement omits the output field names. Therefore, Enform
Plus treats the names of the output fields as if they were new.A, new.B, and
new.C. As the new record description does not contain a field named C, the query
fails and Enform Plus issues an error message.