Translate Table Indexing

The size of a translate table is determined by the size of the source characters (the characters to be translated): 4-bit characters require a 4-word table; 7-bit and 8-bit characters require a 64-word table. A translate table is a one-dimensional read-only array.

Each word in a translate table (Translate Table Indexing ) has its low-order 32 bits divided into four 8-bit fields, numbered 0 to 3 from left to right. The high-order 16 bits are all zeros.

When a character is to be translated, the binary representation of the character is divided into two parts: a word index and a field index. The field index consists of the two low-order bits; the word index consists of the remaining high-order bits. The word index designates the word in the translate table in which the field index designates the character into which the source character is to be translated.

Translate Table Indexing below shows indexing for the translation of a to A that would result from the following declaration:

TRANSLATETABLE UPCASE (EBCDIC TO EBCDIC,
                       "abcdefghijklmnopqrstuvwxyz" TO
                       "ABCDEFGHIJKLMNOPQRSTUVWXYZ")

Figure 1. Translate Table Indexing

Translate Table Indexing