TRNTBL (Translation Table) Keyword--Logical Files Only for Physical and Logical Files

Use this field-level keyword to specify the name of a translation table to be used when passing this field between the physical file on the PFILE or JFILE keyword and your program. The field must be a character field and its length cannot be redefined in the logical file. If the TRNTBL keyword is specified with the CONCAT keyword, the fields specified on the CONCAT keyword must all be character fields.

The format of the keyword is:

TRNTBL([library-name/]translation-table-name)

The translation-table-name is a required parameter value; the library-name is optional. If you do not specify the library-name, the OS/400 program uses the library list (*LIBL) that is in effect at file creation time.

This keyword is valid only for character fields that are input-only (I specified in position 38) or neither (N specified in position 38) fields.

You cannot specify the TRNTBL keyword on a hexadecimal field (H in position 35). Do not specify the TRNTBL keyword on a date, time, or timestamp field (L, T, or Z in position 35).

You can specify as many as 99 different translation tables for different fields in the same logical file.

Translation occurs when the field is read from the physical file. Therefore, all functions specified in the logical file (such as key field sequencing, select/omit processing, and joining of records) depend on the translated version of the data.

The TRNTBL keyword changes the data in the records returned from the logical file. The ALTSEQ keyword changes only the order of the records returned from the logical file.

The TRNTBL keyword is similar to the CHRID keyword, except for the following:

The TRNTBL keyword is not valid when you specify FILETYPE(*SRC) on the Create Logical File (CRTLF) command.

Notes:

  1. When you use the TRNTBL keyword, the length of the field in the logical file must be the same as the length of the corresponding field in the physical file.

  2. At file creation time, you must have use authority to the translation table. The translation table is created using the Create Table (CRTTBL) command.

  3. The translation table specified in the TRNTBL keyword is referred to only when the logical file is created. Therefore, a change to a translation table does not affect the logical file until the logical file is re-created.