Re-Entrant VSAM Compression Exit: ZCOMP1

In this section:

This re-entrant ZCOMP1 exit works with compressed VSAM and sequential files. It requires an initial call to ZCOMP0 for initial housekeeping and a USERWD parameter to anchor storage.

The ZCOMP1 user exit was designed to provide an exit that can be user-supplied in order to decrypt coded fields, expand compressed records, and accomplish any other type of user-specific data manipulation required. This exit is designed to access all files readable by the FOCSAM Interface. It is the user's responsibility to write and maintain this exit.

There are no special Master File requirements. SUFFIX can equal VSAM (for KSDS or ESDS files), FIX (for sequential files), or PRIVATE (for file access through the GETPRV user exit).


Top of page

x
Linking ZCOMP1

After you write a ZCOMP1 user exit, it must be linked with VVSET. This process of linking ZCOMP1 into VVSET can be accomplished by using the GENFSAM JCL that is found in the FOCCTL.DATA data set. Note that GENFSAM is designed to link in both ZCOMP1and GETPRV user exits at the same time. Should you only be implementing one of them, the appropriate lines in the GENFSAM member must be commented out (these would be the INCLUDE OBJECT statements). ZCOMP1 can be linked re-entrant if you plan to use the USERWD parameter.


Top of page

x
What Happens When You Use ZCOMP1

The FOCSAM Interface reads the record for the allocated data source. Upon a successful read, FOCSAM calls ZCOMP1, if it exists, with the parameters listed below so that initial housekeeping can be performed. All subsequent calls are to ZCOMP1 with the same parameter list.

The ZCOMP1 exit is responsible for determining what to do with the parameter information it receives. The DDNAME can be used to determine whether the associated data source needs to be decompressed or not. If not, the user exit typically moves A(IRECLEN) to A(ORECLEN) and A(A(IREC)) to A(A(OREC)) and returns to FOCSAM with a zero A(STATCODE). If decompression or any other processing is required, it is the responsibility of the user exit to do so.

After the user exit has completed its processing, it should return with either the A(ORECLEN), A(A(OREC)) and a zero status code or with a non-zero status code which gives the following message:

(FOC1150) ZCOMP DECOMPRESS ERROR: status

Note: This error terminates a TABLE request.


Top of page

x
ZCOMP1 Parameter List

Parameter

Description

Length

A(STATCODE)*

Pointer to fullword binary status code

4 byte integer

A(DDNAME)

Pointer to 8 byte file name in use

8 byte character

A(USERID)

Reserved for future use

8 byte character

A(IRECLEN)

Pointer to length of original record

4 byte integer

A(A(IREC))

Pointer to pointer to original record

4 byte integer

A(ORECLEN)*

Pointer to length of revised record

4 byte integer

A(A(OREC))*

Pointer to pointer to revised record

4 byte integer

A(USERWD)**

Pointer to fullword

4 byte integer

* The user supplies these parameters.

** This parameter can be used to anchor user storage for re-entrant processing.

Note: Never modify the primary pointers, but rather the pointers or values to which they point.

Note that upon entry to ZCOMP1, the ORECLEN and OREC parameters are NULL. It is the responsibility of the user to fill these in correctly.

While processing the FOCUS FIN command, a call is placed to the ZCOMP2 entry point, which provides the user with the ability to do any other global cleanup required.

The parameters returned by ZCOMP1 are not validated. It is the responsibility of the user routine to ensure that valid addresses and lengths are returned to FOCUS from ZCOMP1.

Unpredictable results occur if incorrect parameters are passed back from the routine.


Information Builders