z/OS CMPSC 圧縮アルゴリズム

JZOS ツールキットには、 z/OS® CMPSC 静的ディクショナリー圧縮アルゴリズム用のラッパー・クラス com.ibm.jzos.ZCompressorが用意されています。 静的ディクショナリー圧縮アルゴリズム (CMPSC など) は、アダプティブ圧縮アルゴリズムと同じ問題を解決しません。 静的圧縮は、個々のデータ・チャンクを圧縮する場合に適しています。一方、GZIP または ZIP プログラムなどで使用されるアダプティブ圧縮は、圧縮されるデータ・ストリームの存続期間にわたって高速化します。

データのチャンクが個別に処理されるシステム (例えば、 Db2® ページ、VSAM 制御インターバル、SAM ディスク・ブロック) は、静的圧縮アルゴリズムの利点を活用する必要があります。

圧縮アルゴリズムおよび CMPSC マシン・インストラクションについて詳しくは、 z/Architecture ® Principles of Operation、 SA22-7832-13 および 「エンタープライズ・システム」 Architecture/390 「データ圧縮」 SA22-7208を参照してください。

SYS1.SAMPLIB(CSRBDICT) SAMPLE REXX プログラムを使用して、代表的なサンプル・データ・セットの圧縮および拡張辞書を作成することができます。 以下のサンプル JCL コードを使用して、これらのディクショナリーを作成し、 ZCompressor クラスの要求に従ってそれらを連結して単一のデータ・セットにすることができます。 詳細については、CSRBDICT プログラムのコメントまたは前の参照に含まれている資料を参照してください。
//CSRBDICT JOB (),’USER’
//*
//* The following symbol defines the data set containing the
//* text that you will scan. This will also become the
//* prefix for other data sets that are created,
//* and assumes that you have created a ".SPECFILE"
//* data set containing the specs for CSRBDICT.
//* In this example, we have downloaded the public domain text
//* of "Moby Dick" from http://www.gutenberg.org/files/2701/2701.txt
//* and we will generate dictionaries with 4K entries which implies
//* 12 bit symbol sizes, since 4096 = 2**(12+3) / 8.
//*
// SET DSNPREF=MYUSER.MOBYDICK
//*
//TSOTMP EXEC PGM=IKJEFT1A,DYNAMNBR=20
//SYSPROC DD DSN=SYS1.SAMPLIB,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
%CSRBDICT 4 1 EB ’MYUSER.MOBYDICK’
//*
//* Concatenate the dictionaries, selecting only
//* the leading (non-blank) 8 bytes from each entry record
//* This assumes that your specfile does NOT have the "asm"
//* option. For this example, the total size in bytes of the
//* output data set will be 64K (4K * 8 * 2).
//*
//CONCAT   EXEC PGM=SORT,COND=(4,LT)
//SORTIN   DD  DSN=&DSNPREF..ACDICT41,DISP=SHR
//         DD  DSN=&DSNPREF..AEDICT41,DISP=SHR
//SORTOUT  DD  DSN=&DSNPREF..CDICTS41,
//             DISP=(NEW,CATLG),SPACE=(CYL,(1)),
//             DCB=(LRECL=8,BLKSIZE=0,RECFM=FB)
//SYSOUT   DD  SYSOUT=*
//SYSIN    DD  *
 OPTION COPY
 INREC FIELDS=(1,8)
//
このサンプル JCL コードの場合、 &DSNPREF..SPECFILE データ・セットの内容は以下のとおりです。
** This is the TEXT FILE example from SYS1.SAMPLIB(CSRBDICT):
**    - removed "asm" option - output is 8-byte binary entries
**    - added "opt"
**
**The following is with a 4K-entry dictionary.
**Provides 30.88% compression (output/input) for the source of
**Chapter 5 of the ESA/390 Principles of Operation (30.32% if all output
**bits are concatenated together).
**Optimization (change x under opt to opt) improves compression by 0.7%.
**results maxnodes maxlevels msglevel stepping prperiod dicts 
  r       40000    60        3        f 7 2 7  1000     afd
**colaps opt treedisp treehex treenode dupccs
  aam    opt x        h       n        x
**FLD col type dcenmen              INT  intspec
  FLD 1   sa   dce 4                INT  aeis 1 (40)
                                    INT  a12b3s (40)
  FLD end
**Note: Some text will be compressed better if the INT aeis 1 (40) is
**omitted; i.e., try it with and without the INT aeis 1 (40). Also, if
**the text is ASCII instead of EBCDIC, the 40 should be changed to 20.