Compressing and Expanding Data

This section contains information on the z/VSE support for compression services. The compression services allow you to compress data and expand data that was previously compressed. The interface to the compression services is the CSRCMPSC macro. The CSRCMPSC macro uses the CMPSC hardware instruction, if available; otherwise, the CSRCMPSC macro simulates the CMPSC instruction.

You can save data in a compressed format, for example to conserve DASD resources. The CSRCMPSC macro provides a pair of services that compress and expand data. These services are available when bit CVTCMPSC in the communication vector table (CVT) is on.

Compression takes an input string of data and, using a data area called a dictionary, produces an output string of compression symbols. Each symbol represents a string of one or more characters from the input.

Expansion takes an input string of compression symbols and, using a dictionary, produces an output string of the characters represented by those compression symbols.

Parameters for the CSRCMPSC macro are in an area mapped by DSECT CMPSC of the CSRYCMPS macro and specified by the CBLOCK parameter of the CSRCMPSC macro. This area contains such information as:
  • The address, ALET, and length of a source area. The source area contains the data to be compressed for a compression operation, or to be expanded for an expansion operation.
  • The address, ALET, and length of a target area. After the macro runs, the target area contains the compressed data for a compression operation, or the expanded data for an expansion operation.
  • An indication of whether to perform compression or expansion.
  • The address and format of a dictionary to be used to perform the compression or expansion. The dictionary must be in the same address space as the source area.
If you are a z/OS (MVS) user, to help you use the compression services, the SYS1.SAMPLIB system library contains the following REXX execs:
  • CSRBDICT for building example dictionaries
  • CSRCMPEX for measuring the degree of compression that the dictionaries provide
The prologs of the execs tell how to use them. For additional information about compression and using the execs, see Enterprise Systems Architecture/390 Data Compression and the Principles of Operation publication for your processor.