Overlapping fields

Within a record format, you can define fields to overlap portions of other fields or their attribute characters; however, only one of those fields is shown on the display at a time.

At run time, when processing overlapping fields within a record, the i5/OS™ program looks at the fields in line and position sequence. When the i5/OS operating system finds a field whose conditioning is satisfied or that does not have an option indicator specified, it selects that field for display and ignores the remaining overlapping fields. The first overlapping field that does not have an option indicator specified always stops the search, and any subsequent overlapping fields are never displayed. In the following example, if indicator 01 is set on, FIELD1 is the only field displayed. If indicator 01 is off and indicator 02 is on, FIELD2 is the only field displayed. FIELD3 is displayed when neither of the others is selected.

Figure 1 shows how to define overlapping fields.

Figure 1. Specify overlapping fields
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A  01        FIELD1        10      1  5TEXT('ONE')
00020A  02        FIELD2         5      1  5TEXT('TWO')
00030A            FIELD3         2  0   1  5TEXT('THREE')
     A

If used incorrectly, this capability can result in problems in user and program communication. In the following example, only one input field (FIELD4) is specified for the record, and according to the field location specification, this field overlaps a preceding output field. The workstation user is not able to type in any data because FIELD1 is always the field selected for display. The other three fields, including FIELD4, are never displayed.

Figure 2 shows an example of incorrect field specification entry.

Figure 2. Incorrect field specification
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A            FIELD1        10      1  5TEXT('ONE')
00020A  21        FIELD2         5      1  5TEXT('TWO')
00030A  12        FIELD3         2  0   1  5TEXT('THREE')
00040A            FIELD4         5Y 2I  1  5TEXT('FOUR')
     A