Previous Topic: RECORD StatementNext Topic: USAGE clause


FIELD Statement

A FIELD statement defines a DL/I field within the named record and corresponds to the FIELD statement in the DBD. Following each RECORD statement, there must be a FIELD statement for every field listed in the DBD for the segment corresponding to the named record. Some records (that is, those corresponding to the logical child segments) will need additional FIELD statements, as explained below. Up to 255 FIELD statements can follow each RECORD statement. If, however, a named record corresponds to a segment for which no fields are defined in the DBD, the RECORD statement stands alone without any FIELD statements.

Five FIELD Statement Formats

There are five FIELD statement formats available:

How to Determine the Appropriate FIELD Statement Format

To determine which format of the FIELD statement is appropriate to define a particular DL/I field, first consider the segment equivalent of the record being described in the RECORD statement. Find the SEGM statement defining the segment and determine whether the segment is a root segment, a dependent segment (that is, with only one parent), or a logical child segment (that is, with two parents). After making this determination, apply the appropriate set of rules as follows:

Define Search Fields with Separate FIELD Statement

Define each of the segment's search fields to the IPSB with a separate FIELD statement following the LOGICAL PARENT FIELD and PHYSICAL PARENT FIELD statements that define the logical parent concatenated key and the physical parent concatenated key, respectively. Next, locate the SEGM statement that defines the associated virtual logical child segment. This SEGM statement is generally not located in the same DBD as the SEGM statement that defines the logical child segment.

If the virtual logical child segment has a sequence field, a LOGICAL SEQUENCE FIELD statement is required to define the sequence field under the named record. For each of the remaining search fields for the virtual logical child segment, there must be a FIELD statement. Each of these FIELD statements must appear under the RECORD statement that identifies the record corresponding to the logical child segment.

USAGE Clause

Each of the five formats of the FIELD statement can end with the optional USAGE clause. As with DL/I, this clause is for documentation purposes only. This clause and the five FIELD statement formats are described separately below.