Algorithme de compression CMPSC z/OS

Le kit d'outils JZOS fournit une classe d'encapsuleur, com.ibm.jzos.ZCompressor, pour l'algorithme de compression de dictionnaire statique CMPSC z/OS® . Les algorithmes de compression de dictionnaire statique, tels que CMPSC, ne résolvent pas les mêmes problèmes que les algorithmes de compression adaptative. La compression statique fonctionne bien pour compresser des blocs discrets de données, alors que la compression adaptative, telle qu'utilisée par les programmes GZIP ou ZIP par exemple, accélère la durée de vie d'un flux de données à compresser.

Tout système sur lequel des blocs de données sont traités de manière discrète (par exemple, des pages Db2® , des intervalles de contrôle VSAM, des blocs de disque SAM) doit bénéficier d'un algorithme de compression statique.

Pour plus d'informations sur l'algorithme de compression et l'instruction machine CMPSC, voir z / Architecture ® Principles of Operation, SA22-7832-13 et Enterprise Systems Architecture/390 Data Compression, SA22-7208.

Vous pouvez utiliser le programme SYS1.SAMPLIB(CSRBDICT) SAMPLE REXX pour créer un dictionnaire de compression et d'extension pour un ensemble de données représentatif. Vous pouvez utiliser l'exemple de code JCL suivant pour créer ces dictionnaires, puis les concaténer en un seul fichier, comme requis par la classe ZCompressor . Pour plus d'informations, consultez la documentation incluse dans les commentaires du programme CSRBDICT ou dans les références précédentes.
//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)
//
Pour cet exemple de code JCL, voici le contenu de l'ensemble de données &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.