Display length
Display length
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 IBM i operating system in the following situations:
- For numeric-only fields with editing, the display length is determined from the edit word or the program length and the edit code.
- For input-capable signed numeric fields, the display length is one more than the program length.
- The display length is one more than the program length for numeric shift fields and for numeric-only fields without editing when these fields are input-capable and have decimal positions greater than zero.
- The display length for floating-point fields is 7 more than the length specified in positions 30 through 34. The 7 extra positions are for the significand sign, the decimal point or comma, the exponent character, the exponent sign, and the 3 exponent digits.
For an unsigned numeric field (like FIELD4 in Figure 1) 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 2, 123 in FIELD4 does not require a decimal character, but 1234 does (123.4). For this field, the display length is 6.
Figure 1. 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
Figure 2. 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