Invoking the ZCOMP Exit

The ZCOMP Exit DLL may be written in C, BAL, or any 3GL languages that follows the parameter passing conventions used in the reference samples and are compiled and linked as a proper DLL. The generated DLL must have an entry point that matches the physical name of the DLL. The default DLL name is ZCOMP.

After you write a ZCOMP user exit, depending upon the platform, you compile and link it as follows:

Platform

Compile/Link Mechanism

USS, UNIX, Windows, IBM i

GENCPGM. (See the Stored Procedures Reference manual for related information.)

z/OS

Build the DLL or link with VVSET using FOCCTL.DATA(GENFSAM) JCL

VM/ESA

Build the DLL or link with VVSET using GENFSAM EXEC

Note:  
  • z/OS linking with VVSET is an obsolete technique that is only supported for backward compatibility.
  • The GENFSAM JCL and EXEC for mainframe are designed to link to both the ZCOMP and the GETPRV user exits at the same time. If you are only implementing one of these exits, the VM EXEC generates the correct linkage to the routine required, whereas the z/OS JCL does not. In the latter case, you must comment out the INCLUDE OBJECT statements in the GENFSAM member.
  • On z/OS, the ZCOMP can be linked as re-entrant if you plan to use the USERWD parameter. For information about GENCPGM usage, see the ibi™ WebFOCUS® Stored Procedure and Subroutine Reference for 3GL Languages manual.

The point in the process at which the ZCOMP Exit DLL is loaded depends on the platform and on whether linking is done with VVSET:

  • Platforms using exits linked into VVSET receive the default ZCOMP exit load when a user session starts; it is unloaded on exit.
  • Platforms using the exit as a DLL load only in response to an explicit request, such as SELECT or TABLE, which must be issued prior to data requests. The commands specify the data source, as in the following illustrations:
    ENGINE VSAMX SET ZCOMP dllname 
    ENGINE CISAM SET ZCOMP dllname 
    ENGINE RMS SET ZCOMP dllname

Users can dynamically change the DLL during the session as needed. The current DLL unloads upon the change to the DLL in use and upon a user session exit.

To force an explicit DLL unload, use the SET command with a non-existent DLL name. The DLL location is defined by the IBICPG environment variable. The main DLL entry point function (which is required to be the same as the DLL name) provides the adapter with the addresses of the ZCOMP0, ZCOMP1 and ZCOMP2 functions.

The VSAM engine is used to process SUFFIX=PRIVATE and multi-segment SUFFIX=FIX files, as well as SUFFIX=VSAM files. The following command is used for FIX and PRIVATE:

ENGINE VSAMX SET ZCOMP