Use these positions to specify the exact location on the display where each field begins. You cannot specify a location for hidden, program-to-system, or message fields. The validity of the location is based on the DSPSIZ keyword and the display size condition names. See DSPSIZ (Display Size) keyword for display files for specific examples.
Use these positions to specify the line on which the field begins. The entry must be right-justified. Leading zeros are optional. The maximum number of lines is 24 or 27. See Table 1 for more information on display size condition names.
Use these positions to specify the starting position of the field within the line you specified. Your entry must be right-justified. Leading zeros are optional. The maximum position is 132 for the 3180 device and 80 for all of the remaining display devices.
For fields other than the first field within the record, you can specify the location by specifying a plus value (+n) for positions 42 through 44. The plus value indicates the number of spaces to be left between the end of the previous field and the start of the field you are defining. The plus value must be in the range of 1 through 99. (A plus value of zero is not valid.)
Each field displayed has one attribute character that defines the display attribute of the field on the display. This attribute character is not displayed, but occupies one position on the display immediately preceding the field. Because of the beginning attribute character, you cannot specify that a field is to begin in the first position of the display (line 1, position 1), unless the SLNO (Starting Line Number) keyword is specified and the start line number is greater than 1.
When a field begins in position 1 the beginning attribute character occupies the last position of the preceding line. If such a field is the first field of a record, the preceding line is a part of the record area and displayed as a blank line. Any record format using that line cannot be displayed at the same time as the other record. The last one to be displayed causes the other one to be deleted (unless CLRL(*NO) is specified for the last displayed record).
The end of a field on the display is indicated by an ending attribute character, unless there is only one space between that field and the next field. In that case, the beginning attribute character of the second field serves as the ending attribute character of the first field. In any case, there must always be at least one space left between fields in a record. When the last position occupied by a field of a record is the last position in a line, the ending attribute character for the field is in position 1 of the next line. However, the next line is not considered part of the first record, and records can be displayed on both lines at once.
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 OS/400 program looks at the fields in line and position sequence. When the OS/400 program 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 7 shows how to define overlapping fields.
Figure 7. Specifying 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 8 shows an example of incorrect field specification entry.
Figure 8. 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
The display length is increased for certain types of fields and must be considered when laying out the display. The display length is increased by the OS/400 program in the following situations:
For an unsigned numeric field (like FIELD4 in Figure 8) with a nonzero decimal position, the system requires a decimal character to be typed into the field when decimal values are typed in as data. In Figure 7, 123 in FIELD4 does not require a decimal character, but 1234 does (123.4). For this field, the display length is 6.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.