Compressing database keys

After analyzing the control statements specified by the user, IMS Sequential Randomizer Generator generates a database key compression routine and compresses the input database keys in order to improve the key analysis efficiency. Key compression is performed according to the key attributes specified in the control statement.

A single key attribute can be specified for an entire field, or different key attributes can be specified for each subkey field. The compressed keys are stored in a work data set called compressed key file, or in private storage above 16 MB line (see the KEYNBR parameter description in KEYNBR).

The generated key compression routine becomes a part of the SR and is used whenever SR is called during IMS execution.

The following table shows the subkey field attributes and the compressed key length:
Table 1. Key Attributes and Compressed Key Length
Subkey Field Attribute Parameter Value Original Key Length and Compressed Key Length
Hexadecimal data X 8 bits → 8 bits
Unsigned packed decimal data P
1 byte → 7 bits
2 bytes → 14 bits
3 bytes → 20 bits
4 bytes → 27 bits
Signed packed decimal data S
1 byte → 4 bits
2 bytes → 10 bits
3 bytes → 17 bits
4 bytes → 24 bits
5 bytes → 30 bits
Alphabetic data (including a blank) A 8 bits → 5 bits
Numeric data (0 to 9) N
1 byte → 4 bits
2 bytes → 7 bits
3 bytes → 10 bits
4 bytes → 14 bits
5 bytes → 17 bits
6 bytes → 20 bits
7 bytes → 24 bits
8 bytes → 27 bits
9 bytes → 30 bits
Alphanumeric data (including a blank) C 8 bits → 6 bits
Character data Q 8 bits → 6 bits
Specific character data U Depends on parameter
Katakana* Y 8 bits → 6 bits
Katakana and character data Z 8 bits → 7 bits
Ignored data I 1 byte (fixed)
*: Katakana is a Japanese unique phonetic character set.