FIND Statement
Statements
4–18
058057 Tandem Computers Incorporated
3.
If you omit output-field-name, ENFORM assumes that 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
assumes that the name of the output fields are new.A, new.B, and new.C. Since
the new record description does not contain a field named C, the query fails and
ENFORM issues an error message.
4.
Output-field-name can be a group name; however, ENFORM might not store the
fields within the group in the manner you expect. To understand the way that
ENFORM stores group elements, you must first understand what a group is. A
group is defined in DDL as any field whose level number (03, 04, ...) is less than
that of the next field in the record. Consider, for example, the following DDL
record description:
RECORD findfl.
FILE IS $mkt.sample.findfl key-sequenced.
02 account-num.
05 type PIC 9(4).
05 num PIC BINARY 16.
02 custnum PIC 9(4).
Within this record, account-num is a group. The data type of a group is always
alphanumeric. When a group name is specified as output-field-name within a FIND
statement, ENFORM stores each element within the group as alphanumeric data. If
one of the fields within the group is defined as binary, using a group name as output-
field-name results in an output record that might contain undesirable data. (The
undesirable results occur because the binary representation of some numbers does not
correspond to the ASCII representation of these same numbers.)
Before the FIND statement executes, the dictionary must include a record description
that defines the structure of the input record. This record description also defines the
file type (key-sequenced, relative, entry-sequenced, or unstructured) of any data file
that can be associated with the record description. The actual file type of the data file
must be the same as the file type specified in the record description; otherwise, your
query might return incorrect results.
Summary of Contents for ENFORM
Page 6: ...New and Changed Information 058057 Tandem Computers Incorporated v...
Page 18: ...Preface xvi 058057 Tandem Computers Incorporated This page left intentionally blank...
Page 19: ...Preface 058057 Tandem Computers Incorporated xvii...
Page 269: ...Glossary Glossary 4 058057 Tandem Computers Incorporated This page left intentionally blank...