Length for printer files (positions 30 through 34)

Use these positions to specify the field length for each named field (unless you copy it from a referenced field).

Your entry represents the number of bytes of data to be passed from your program when an output operation is done for this field. (If the field is to be edited, the associated edit code or edit word is used to determine the printed length of the field.) Figure 1 shows how to code the field length.

The maximum length of a zoned decimal field is 63. Data description specifications allow a maximum field length of 32 767 characters. If the field length causes the field to extend beyond the page size, a warning diagnostic appears. The maximum length of a single precision floating-point field is 9 digits; the maximum length of a double precision floating-point field is 17 digits.

If you use a referenced field, override the referenced length by specifying a new value or by specifying the increase or decrease in length. To increase the length, specify +n, where n is the increase. To decrease the length, specify -n, where n is the decrease. For example, an entry of +4 indicates that the field is to be 4 digits longer than the referenced field. The field length can be overridden without overriding the decimals.

If you specify length, it must be right-aligned; leading zeros are optional.

The following example shows correct and incorrect field-length specifications. FIELD1 shows the field length specified incorrectly. FIELD2 and FIELD3 show the field length specified correctly.

|...+....1....+....2....+....3....+....4....+....5
00010A            FIELD1       7
     A
00020A            FIELD2         7
     A
00030A            FIELD3    R   +7

For floating-point fields, 7 positions will be added to the length you specify 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 exponent.

In some cases, if you specify a value for length, some keywords specified with the field in the database file are not included in the printer file.

Related concepts
Reference for printer files (position 29)