Layout of output fields

The layout of output fields vary based on a variety of factors, including whether the field is varying-length or fixed-length and whether the field is nullable.

Output fields can have the following layouts:
  • Fixed-length
  • Nullable fixed-length
  • Varying-length field
  • Varying-length field without the NOPAD option
  • Nullable varying-length field with the NOPAD option
  • Nullable varying-length field without the NOPAD option

The following figure shows the layout of a fixed-length field that cannot be null. This diagram shows that the data field begins at a specified position, or at the next byte position past the end of the previous data field. The data field then continues for the specified length or the length of the column in the table definition. For GRAPHIC EXTERNAL data, shift-in and shift-out characters are inserted before and after the data.

Figure 1. Layout of a fixed-length field (NOT NULL)
Begin figure summary. The data field begins at the specified position and ends at the default position of the next field. Detailed description available.

The following figure shows the layout of a fixed-length field that can be null. This diagram shows that a null indicator byte is stored before the data field, which begins at the specified position or at the next byte position past the end of the previous data field.

Figure 2. Layout of a nullable fixed-length field
Begin figure summary. A null indicator byte is stored before the specified position of the data field. Detailed description available.

If you are running UNLOAD with the NOPAD option and need to determine the layout of a varying-length field that cannot be null, see the layout diagram in the following figure. The length field begins at the specified position or at the next byte position past the end of the previous data field.

Figure 3. Layout of a varying-length field (NOT NULL) with the NOPAD option
Begin figure summary. The length field is stored after the specified position and before the data field. Detailed description available.

For UNLOAD without the NOPAD option, the layout of a varying-length field that cannot be null is depicted in the following figure.

Figure 4. Layout of a varying-length field (NOT NULL) without the NOPAD option
Begin figure summary. The length field is stored after the specified position and before the data field. The padding is stored after the data field. Detailed description available.

For UNLOAD with the NOPAD option, the layout of a varying-length field that can be null is depicted in the following figure. The length field begins at the specified position or at the next byte position past the end of the previous data field.

Figure 5. Layout of a nullable varying-length field with the NOPAD option
Begin figure summary. A null indicator is stored before the length field, which is stored before the data field. Detailed description available.

For UNLOAD without the NOPAD option, the layout of a varying-length field that can be null is depicted in the following figure. The length field begins at the specified position or at the next byte position past the end of the previous data field.

Figure 6. Layout of a nullable varying-length field without the NOPAD option
Begin figure summary. A null indicator is stored before the length field, which is stored before the data field. The padding is stored after the data field. Detailed description available.