Sample DSN1COMP control statements
Use the sample control statements as models for developing your own DSN1COMP control statements.
Example 1: Estimating space savings from data compression for a full image copy
The following statement specifies that the DSN1COMP utility is to report the estimated space savings that are to be achieved by compressing the full image copy that is identified by the SYSUT1 DD statement. In this statement, the DSN value specifies the data set name of the image copy that is to be used as input. Because the input is a full image copy, the FULLCOPY parameter must be specified.
//jobname JOB acct information
//COMPEST EXEC PGM=DSN1COMP,PARM='FULLCOPY'
//STEPLIB DD DSN=prefix.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DSN=COPY001F.IFDY01,DISP=SHRExample 2: Providing intended free space when estimating space savings
In the following sample statement, STEP1 specifies that DSN1COMP is to report the estimated space savings that are to be achieved by compressing the data in the data set that is identified by the SYSUT1 DD statement, DSNC810.DSNDBD.DB254SP4.TS254SP4.I0001.A00. When calculating these estimates, DSN1COMP considers the values passed by the PCTFREE and FREEPAGE options. The PCTFREE value indicates that 20% of each page is to be left as free space. The FREEPAGE value indicates that every fifth page is to be left as free space. This value must be the same value that you specified for the FREEPAGE option of the SQL statement CREATE TABLESPACE or ALTER TABLESPACE.
STEP2 specifies that DSN1COMP is to report the estimated space savings that are to achieved by compressing the data in the data set that is identified by the SYSUT1 DD statement, DSNC810.DSNDBD.DB254SP4.TS254SP4.I0001.A0001. When providing the compression estimate, DSN1COMP is to evaluate no more than 20,000 rows, as indicated by the ROWLIMIT option. Specifying the maximum number of rows to evaluate limits the elapsed time and processor time that DSN1COMP requires.
//DSN1COMP JOB MSGLEVEL=(1,1),CLASS=A,MSGCLASS=A,REGION=3000K,
// USER=SYSADM,PASSWORD=SYSADM
/*ROUTE PRINT STLXXXX.USERID
//STEP1 EXEC PGM=DSN1COMP,PARM='PCTFREE(20),FREEPAGE(5)'
//STEPLIB DD DSN=prefix.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSDUMP DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DSN=DSNC112.DSNDBD.DB254SP4.TS254SP4.I0001.A001,DISP=SHR
/*
//STEP2 EXEC PGM=DSN1COMP,PARM='ROWLIMIT(20000)'
//STEPLIB DD DSN=prefix.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSDUMP DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DSN=DSNC112.DSNDBD.DB254SP4.TS254SP4.I0001.A001,DISP=SHR
/*
//
Example 3: Estimating space savings that are comparable to what the REORG utility would achieve
The following statement specifies that DSN1COMP is to report the estimated space savings that are to be achieved by compressing the data in the data set that is identified by the SYSUT1 DD statement, DSNCAT.DSNDBD.DBJT0201.TPJTO201.I0001.A254. This input data set is a table space that was defined with the LARGE option and has 254 partitions, as indicated by the DSN1COMP options LARGE and NUMPARTS.
The REORG option indicates that DSN1COMP is to provide an estimate of compression savings that is comparable to the savings that the REORG utility would achieve, rather than what the LOAD utility would achieve.
When calculating these estimates, DSN1COMP considers the values passed by the PCTFREE and FREEPAGE options. The PCTFREE value indicates that 30% of each page is to be left as free space. The FREEPAGE value indicates that every thirtieth page is to be left as free space. This value must be the same value that you specified for the FREEPAGE option of the SQL statement CREATE TABLESPACE or ALTER TABLESPACE. DSN1COMP is to evaluate no more than 20,000 rows, as indicated by the ROWLIMIT option.
//STEP2 EXEC PGM=DSN1COMP,
// PARM='LARGE,PCTFREE(30),FREEPAGE(30),NUMPARTS(254),
// REORG,ROWLIMIT(1000)'
//STEPLIB DD DSN='USER.TESTLIB',DISP=SHR
// DD DSN='DB2A.SDSNLOAD',DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSDUMP DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DSN=DSNCAT.DSNDBD.DBJT0201.TPJT0201.I0001.A254,DISP=SHR
//SYSUT2 DD SYSOUT=A
/*
Example 4: Building an Object Module from the DSN1COMP generated dictionary
In the sample statement, BUILD specifies that DSN1COMP is to externalize the compression dictionary that it generated. This behavior is indicated by the EXTNDICT option, which requires that a DSN1DICT DD statement be provided. DSN1DICT identifies the output data set to which the generated object module is written and stored for additional processing.
//BUILD EXEC PGM=DSN1COMP,
// PARM='DSSIZE(4G),EXTNDICT(dictname)'
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DSN=DSNCAT.DSNDBD.DBIA2401.TPIA2401.I0001.A254,
// DISP=SHR
//DSN1DICT DD DSN=&&OBJ,
// DISP=(,PASS),
// UNIT=SYSALLDA,SPACE=(TRK,(8,4)),
// DCB=(LRECL=80,BLKSIZE=4000,RECFM=FB)
Example 5: Estimating space savings and LOB compression rations for a LOB table space
The following statement specifies that DSN1COMP is to report the estimated space savings that are to be achieved by compressing the LOB data in the data set that is identified by the SYSUT1 DD statement, DB2SMS.DSNDBC.DBP27940.TAP27901.I0001.A001. This input data set is a LOB table space that is not defined with the COMPRESS YES option.
//STEP2 EXEC PGM=DSN1COMP,
// PARM='LOB'
//STEPLIB DD DSN='USER.TESTLIB',DISP=SHR
// DD DSN='DB2A.SDSNLOAD',DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSDUMP DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DSN=DB2SMS.DSNDBC.DBP27940.TAP27901.I0001.A001,DISP=SHR
//SYSUT2 DD SYSOUT=A
/*
Example 6: Estimating space savings for Huffman compression and fixed-length compression
The following example specifies that DSN1COMP is to report the estimated space savings that are to be achieved by both Huffman compression and fixed-length compression.
//COMPTS2 EXEC PGM=DSN1COMP,
// PARM='COMPTYPE(ALL),REORG'
//STEPLIB DD DSN=USER.TESTLIB,DISP=SHR
// DD DSN=DB2A.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSDUMP DD SYSOUT=A
//SYSABEND DD SYSOUT=A
//SYSUT1 DD DISP=SHR,DSN=DSNC000.DSNDBC.EMPDB.EMPSPACE.I0001.A001
/*

Example 7: Requesting external compression dictionaries
The following example specifies that DSN1COMP is to report the estimated space savings that are to be achieved by both Huffman compression and fixed-length compression and produce external copies of both the fixed compression dictionary and the Huffman compression dictionary.
//STEP EXEC PGM=DSN1COMP,PARM='COMPTYPE(ALL),EXTNDICT(FIXEDICT),EXTHDICT(HUFFDICT)'
//STEPLIB DD DSN=USER.TESTLIB,DISP=SHR
// DD DSN=DB2A.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DISP=SHR,DSN=DSNC000.DSNDBC.DB1.TS1.I0001.A001
//SYSUT2 DD SYSOUT=A
//DSN1DICT DD DSN=DSN1COMP.DICT0001,DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE)
//DSN2DICT DD DSN=DSN1COMP.DICT0002,DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE)
This sample returns the following output:
DSN1999I START OF DSN1COMP FOR JOB DSN1CMP STEP2
DSN1998I INPUT DSNAME = DSNC000.DSNDBC.DB1.TS1.I0001.A001 , VSAM
DSN1944I DSN1COMP INPUT PARAMETERS
INPUT DATA SET CONTAINS COMPRESSED DATA
USING FIXED-LENGTH COMPRESSION TYPE
INPUT DICTIONARY BUILT BY INSERT
4,096 DICTIONARY SIZE USED
0 FREEPAGE VALUE USED
5 PCTFREE VALUE USED
COMPTYPE(ALL) REQUESTED
NO ROWLIMIT WAS REQUESTED
ESTIMATE BASED ON DB2 LOAD METHOD
255 MAXROWS VALUE USED
FIXEDICT EXTERNAL FIXED DICTIONARY OBJECT NAME
HUFFDICT EXTERNAL HUFFMAN DICTIONARY OBJEC TNAME
DSN1940I DSN1COMP COMPRESSION REPORT
HARDWARE SUPPORT FOR HUFFMAN COMPRESSION IS AVAILABLE
+-----------------------------------+------------------+------------------+------------------+------------------+
| | | Estimated state | Estimated state | Calculated |
| | UNCOMPRESSED | Compressed | Compressed | Compressed from |
| | | FIXED | HUFFMAN | INPUT DICTIONARY |
+-----------------------------------+------------------+------------------+------------------+------------------+
| DATA (IN KB) | 1,758 | 1,232 | 1,186 | 1,758 |
| PERCENT SAVINGS | | 29% | 32% | 0% |
| | | | | |
| AVERAGE BYTES PER ROW | 38 | 28 | 27 | 38 |
| PERCENT SAVINGS | | 26% | 28% | 0% |
| | | | | |
| DATA PAGES NEEDED | 496 | 365 | 353 | 496 |
| PERCENT DATA PAGES SAVED | | 26% | 28% | 0% |
| | | | | |
| DICTIONARY PAGES REQUIRED | 0 | 16 | 20 | 16 |
| ROWS SCANNED TO BUILD DICTIONARY | | 5,311 | 5,311 | N/A |
| ROWS SCANNED TO PROVIDE ESTIMATE | | 50,000 | 50,000 | N/A |
| DICTIONARY ENTRIES | | 4,096 | 4,080 | 4,096 |
| | | | | |
| TOTAL PAGES (DICTIONARY + DATA) | 496 | 381 | 373 | 512 |
| PERCENT SAVINGS | | 23% | 24% | 0% |
+-----------------------------------+------------------+------------------+------------------+------------------+
DSN1937I DSN1COMP TXT-DECK FIXEDICT BUILT 1,173 RECORDS WRITTEN
DSN1937I DSN1COMP TXT-DECK HUFFDICT BUILT 1,391 RECORDS WRITTEN
DSN1994I DSN1COMP COMPLETED SUCCESSFULLY, 491 PAGES PROCESSED
