Algoritmo di compressione CMPSC z/OS
Il toolkit JZOS fornisce una classe wrapper, com.ibm.jzos.ZCompressor, per l'algoritmo di compressione del dizionario statico CMPSC z/OS® . Gli algoritmi di compressione del dizionario statico, come CMPSC, non risolvono gli stessi problemi degli algoritmi di compressione adattiva. La compressione statica funziona bene per comprimere blocchi discreti di dati, mentre la compressione adattiva, come utilizzata per esempio dai programmi GZIP o ZIP, accelera la durata di un flusso di dati da comprimere.
Qualsiasi sistema in cui i blocchi di dati vengono elaborati in modo discreto (ad esempio, pagine Db2® , intervalli di controllo VSAM, blocchi disco SAM) dovrebbe beneficiare di un algoritmo di compressione statico.
Per ulteriori informazioni sull'algoritmo di compressione e sull'istruzione macchina CMPSC, consultare z / Architecture ® Principles of Operation, SA22-7832-13 e Enterprise Systems Architecture/390 Data Compression, SA22-7208.
SYS1.SAMPLIB(CSRBDICT) SAMPLE REXX per creare un dizionario di compressione ed espansione per un dataset di esempio rappresentativo. È possibile utilizzare il seguente codice JCL di esempio per creare questi dizionari, quindi concatenarli in un singolo dataset come richiesto dalla classe ZCompressor . Per ulteriori informazioni, consultare la documentazione inclusa nei commenti del programma CSRBDICT o nei riferimenti precedenti.//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)
//&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.