Key Compression

Key compression is a technique that can be applied to the keys of an indexed file. There are four types of compression available:

You can specify key compression using the KEYCOMPRESS option in the File Handler configuration file. Use the following integers to indicate which type of compression you want:

1
Duplicate key compression.
2
Leading character compression.
4
Trailing space compression.
8
Trailing null compression.

You can add these numbers together to specify a combination of compression types (with the exception of trailing nulls and trailing spaces which are mutually exclusive).

Alternatively, you can use the KEYCOMPRESS Compiler directive when compiling the program.

The key compression used by a file is determined by the last processed KEYCOMPRESS directive when the SELECT statement for the file is processed so you can set key compression for an individual file by using a line of the form:

$SET KEYCOMPRESS"8"

immediately before its SELECT statement in your program. You can turn it off again by specifying $SET NOKEYCOMPRESS before any other files are processed.