Skip to main content

Preface

The INFOPAK DATACOM/DB option enables compression of DATACOM/DB data bases while remaining totally transparent to application programs. INFOPAK DATACOM/DB is very easily installed in the following manner:

  • the compression modules, delivered on the installation tape, are copied into a load module library.

  • compression for a MASTER LIST is specified by indicating the INFOPAK module name in the "CMPEXIT=" parameter of the BLSTBL macro that describes the MASTER LIST.

In all cases, the initial load is executed with the help of regular utilities and unload/reload procedures.

The operation of the compression routine is transparent to the application programs. Employing artificial intelligence techniques, INFOPAK DATACOM/DB uses high speed scanning to perform a three-dimensional analysis of data and then makes compression decisions based on the type of data. The scanning program may decide to use several different encoding methods within the data for optimum performance/compression. The primary compression technique used by INFOPAK DATACOM/DB is derived from the HUFFMAN algorithm, and enables data to be represented in the form of bit strings of variable length. Other techniques allow up to 31 bytes of blanks or zero packed fields to be compressed to a single byte. Naturally, when these types of fields are eventually updated, they will occupy more space. INFOPAK DATACOM/DB compresses user data only.

How to use INFOPAK

To install INFOPAK DATACOM/DB you must specify CMPEXIT=INFDTCPE in the DBLSTBL macro instructions of all applicable MASTER LISTs (multi-users and utilities). If CMPEXIT is already specified, it means you are already utilizing a user-written compression routine. You will then need to create new MASTER LISTs to evaluate INFOPAK.

After the new MASTER LISTs are recompiled and installed, you may compress one or several tables. For each table, this is a five step procedure:

  • Step 1 Unload the table

  • Step 2 Re-initialize the table

  • Step 3 Define compression parameters

  • Step 4 Activate compression

  • Step 5 Reload the table

Unloading the table

This step is performed by DBUTLTY using the BACKUP AREA function and specifying CMPRS=NO if the table is already compressed by another routine.

Re-initializing the table

The unloaded table must be re-initialized to allow compression to be performed. Use DBUTLTY for this function.

Defining compression parameters

Compression is defined on a table basis by the model structure maintenance transaction (DDLC).

  • Write N in the field "COMPRESS : Y/N". This will de-activate the standard exit.

  • Write INFDTCPE in the next field "COMPRESS : EXIT". This will define INFOPAK as the unique compression exit for this table.

Activating compression

Compression is activated by copying the definition via the COPY (PROD) function of DBUTLTY.

Reloading the table

This step is performed by DBUTLTY using the LOAD AREA function from the backup copy made in step one. The table is then compressed; You can then compare its new size with the original size to evaluate the space savings achieved by INFOPAK.

Using INFCMR00 and INFSMR00

The module INFCMRE0 provided by INFOPAK has an entry point INFCMR00 to perform the compression or decompression of any data area. The module is reentrant and can be used by COBOL or ASSEMBLER programs to compress or decompress data sets.

The module INFSMR00 provided by INFOPAK has an entry point INFSMR00 to perform the compression or decompression of any data area. This module gives lower CPU consumption (but with a good compression rate) than INFCMR00.

Calling INFCMR00 or INFSMR00

The call is made with five parameters:

  1. Function code

    This word (PIC S9(8) COMP in COBOL) indicates whether this is compression or decompression. This word must be initialized with zero for compression and 4 for decompression.

  2. Input area

    Name of the field which contains the input data to compress or decompress depending on the function code.

  3. Length of the input area

    This word (PIC S9(8) COMP in COBOL) contains the length of the input area.

  4. Output area

    Depending on the function code, this area contains the compressed or the decompressed data after the call.

  5. Length of the output area

    This word (PIC S9(8) COMP in COBOL) indicates the required length of the output area. When returning control to the calling program INFCMR00 or INFSMR00 places the actual length of the compressed or decompressed output into this field. If the length specified here initially was insufficient (i.e. the resultant compressed or decompressed data is longer than the output length that was specified), INFCMR00 or INFSMR00 fills the output area with the compressed or decompressed data up to the insufficient length and issues a return code (RETURN-CODE in COBOL) of 4.

note

Each parameter is mandatory.

Cobol example with INFCMR00



*
* CALL PARAMETERS
*
01 INPLNGTH PIC S9(08) COMP.
01 INPAREA PIC X(100).
01 OUTLNGTH PIC S9(08) COMP.
01 OUTAREA PIC X(101).
01 FUNC PIC S9(08) COMP.
*
* 1) COMPRESSION
*
MOVE 0 TO FUNC. COMPRESSION
MOVE 100 TO INPLNGTH. LENGTH OF DATA TO BE COMPRESSED
MOVE 101 TO OUTLNGTH. LENGTH OF COMPRESSED DATA
CALL \'INFCMR00\' USING FUNC INPAREA INPLNGTH OUTAREA OUTLNGTH.
*
* 2) DECOMPRESSION
*
MOVE 4 TO FUNC. DECOMPRESSION
MOVE OUTLNGTH TO INPLNGTH. INITIALIZE INPUT LENGTH
MOVE OUTAREA TO INPAREA. AND INPUT AREA
MOVE 101 TO OUTLNGTH. LENGTH OF DECOMPRESSED DATA
CALL \'INFCMR00\' USING FUNC INPAREA INPLNGTH OUTAREA OUTLNGTH.

Assembler example with INFCMR00



*
* CALL PARAMETERS
*
INPLNGTH DS F
INPAREA DC CL100\' \'
OUTLNGTH DS F
OUTAREA DS 0CL101
FUNC DS F
*
* 1) COMPRESSION
*
LA 7,0
ST 7,FUNC FUNCTION CODE
LA 7,100
ST 7,INPLNGTH LENGTH OF DATA TO BE COMPRESSED
LA 7,101
ST 7,OUTLNGTH LENGTH OF COMPRESSED DATA
CALL INFCMR00,(FUNC,INPAREA,INPLNGTH,OUTAREA,OUTLNGTH),VL
*
* 2) DECOMPRESSION
*
LA 7,4
ST 7,FUNC FUNCTION CODE
L 7,OUTLNGTH
ST 7,INPLNGTH INITIALIZE INPUT LENGTH
BCTR 7,0
EX 7,EXMOVE AND INPUT AREA
LA 7,101
ST 7,OUTLNGTH LENGTH OF DECOMPRESSED DATA
CALL INFCMR00,(FUNC,INPAREA,INPLNGTH,OUTAREA,OUTLNGTH),VL
BR 14
*
EXMOVE MVC INPAREA(0),OUTAREA

note

The two preceding examples illustrate the compression of a data area followed by its decompression. When calling for decompression, the example reinitializes the length of the input area with the output length that was provided by INFCMP00 when it performed the compression and reinitializes the input area with the compressed data from the output area. The length of the output area was reinitialized to be the same as it was for compression.

note

Notice that for compression the length of the output area is one byte more than the input area. This guarantees, in compression, that the output length will be sufficient.