データ圧縮およびキー圧縮の例

次のプログラムでは、transfile にデータ圧縮を指定します。masterfile に対してはデータ圧縮を指定しません。キー圧縮については、キー t-rec-key および m-rec-key に対して、前のキーと同じ後続空白文字および先頭文字の抑制を指定します。

m-alt-key-1 および m-alt-key-2 に対しては、重複キーの繰り返しも抑制します。これは、重複を許可しない m-alt-key-1 では無視されます。

$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