Example of Data and Key Compression

In the following program, data compression is specified for transfile but not for masterfile. For key compression, suppression of trailing spaces and of leading characters that are the same as in the previous key is specified for keys t-rec-key and m-rec-key.

Suppression of repetition of duplicate keys is also turned on for m-alt-key-1 and m-alt-key-2. This is ignored for m-alt-key-1 which does not allow duplicates.

$set callfh"extfh"
$set datacompress"1"
$set keycompress"6"
     select transfile
         assign to "user.dat"
         organization is indexed
         record key is t-rec-key.
$set nokeycompress
$set nodatacompress

     select masterfile
         assign to "stock.dat"
         organization is indexed
$set keycompress"6"
         record key is m-rec-key
$set keycompress"7"
         alternate key is m-alt-key-1 with duplicates
         alternate key is m-alt-key-2.
$set nokeycompress