DSN1COMP

The DSN1COMP stand-alone utility estimates space savings that are to be achieved by DB2® data compression in table spaces and indexes.

You can run this utility on the following types of data sets that contain uncompressed data:

  • DB2 full image copy data sets
  • VSAM data sets that contain DB2 table spaces
  • Sequential data sets that contain DB2 table spaces (for example, DSN1COPY output)
Restrictions:

You cannot run DSN1COMP on concurrent copies.

DSN1COMP does not estimate savings for data sets that contain LOB table spaces.

If you run DSN1COMP on a table space in which the data is the same for all rows, message DSN1941I is issued. In this case, DSN1COMP does not compute any statistics.

Environment

Run DSN1COMP as a z/OS® job.

You can run DSN1COMP even when the DB2 subsystem is not operational. Before you use DSN1COMP when the DB2 subsystem is operational, issue the DB2 STOP DATABASE command. Issuing the STOP DATABASE command ensures that DB2 has not allocated the DB2 data sets.

Do not run DSN1COMP on table spaces in DSNDB01, DSNDB06, or DSNDB07.

Authorization required

DSN1COMP does not require authorization. However, if any of the data sets is RACF-protected, the authorization ID of the job must have RACF® authority.

Required data sets

DSN1COMP uses the following data definition (DD) statements:

SYSPRINT
Defines the data set that contains output messages from DSN1COMP and all hexadecimal dump output.
SYSUT1
Defines the input data set, which can be a sequential data set or a VSAM data set.

Specify the disposition for this data set as OLD (DISP=OLD) to ensure that it is not in use by DB2. Specify the disposition for this data set as SHR (DISP=SHR) only in circumstances where the DB2 STOP DATABASE command does not work.

The requested operation takes place only for the specified data set. In the following situations, you must specify the correct data set.

  • The input data set belongs to a nonpartitioned table space.
  • The index space is larger than 2 GB.
  • The table space or index space is a partitioned space.

If you are running the online REORG utility with FASTSWITCH behavior, verify the data set name before running the DSN1COMP utility. The fifth-level qualifier in the data set name alternates between 'I0001' and 'J0001' when using FASTSWITCH. If the table space has cloning, the fifth-level qualifier can be 'n0002.' You cannot specify FASTSWITCH YES if the table space has cloning; however, a FASTSWITCH YES REORG might have been done before the clone was created so you might still have a mixture of 'I' and 'J' data sets. Specify the correct fifth-level qualifier in the data set name to successfully execute the DSN1COMP utility. To determine the correct fifth-level qualifier, query the IPREFIX column of SYSIBM.SYSTABLEPART for each data partition or the IPREFIX column of SYSIBM.SYSINDEXPART for each index partition. If the object is not partitioned, use zero as the value for the PARTITION column in your query.

DSN1DICT
DSN1DICT is required only if you specify the EXTNDICT parameter, to create an external copy of the compression dictionary that DSN1COMP produces.
DSN1DICT defines the output data set to which the external copy of the compression dictionary is written. This data set must:
  • Be a sequential data set or a member of a partitioned data set
  • Have fixed record format with a record length of 80

The data set or data set member that is produced is an object module that can be link-edited into a program.

Recommendation

Before using DSN1COMP, be sure that you know the page size and data set size (DSSIZE) for the table space. Use the following query on the DB2 catalog to get the information you need, in this example for table 'DEPT':

SELECT T.CREATOR,T.NAME,S.NAME AS TABLESPACE,S.PARTITIONS,S.PGSIZE,      
     CASE S.DSSIZE                                      
     WHEN 0 THEN                                        
                 CASE WHEN S.TYPE = 'G' THEN 4194304    
                      WHEN S.TYPE = 'O' THEN 4194304    
                      WHEN S.TYPE = 'P' THEN 4194304    
                      WHEN S.TYPE = 'R' THEN 4194304    
                 ELSE                                   
                      CASE WHEN S.PARTITIONS > 254 THEN 
                           CASE WHEN S.PGSIZE = 4  THEN  4194304        
                                WHEN S.PGSIZE = 8  THEN  8388608        
                                WHEN S.PGSIZE = 16 THEN 16777216        
                                WHEN S.PGSIZE = 32 THEN 33554432        
                           ELSE NULL              
                           END                         
                           WHEN S.PARTITIONS > 64 THEN 4194304   
                           WHEN S.PARTITIONS > 32 THEN 1048576   
                           WHEN S.PARTITIONS > 16 THEN 2097152   
                           WHEN S.PARTITIONS > 0  THEN 4194304   
                      ELSE 2097152                          
                      END   
                 END
      ELSE S.DSSIZE       
      END                      
      AS DSSIZE                     
      FROM SYSIBM.SYSTABLES T,           
           SYSIBM.SYSTABLESPACE S             
      WHERE                                        
           T.NAME = 'DEPT' AND                          
           T.TSNAME = S.NAME;