Skip to content

CMNDB2DD - HLL exit

This HLL exit, while developed with Native SQL SPs in mind, can apply equally well to any DDL/SQL object which is processed by CMNDB2DD.

As mentioned in the description of the new CMNDB2DD sysin parameter 'HLLX=', CMNDB2DD now takes a High Level Language user exit. However, note that the mechanism for this is not via the standard HLLX stc call process. CMNDB2DD calls the exit directly itself and only makes use of the existing HLLX 'paradigm' in that it can call either a REXX exec or an LE-enabled language load module. If the exit is a REXX exec then the JCL for the CMNDB2DD step must include a //HLLXREXX dd statement from which the exec will be loaded. If it is an LE-program then it will be loaded from the usual places (step/joblib).

The SQL sentence currently being processed is written to a temporary file with the ddname of DDLIN, the exit can work with that ddname, read the DDL from the file, validate or change it. If validation fails then the relevant 'proceed' variable can be set to 'NO' and a message can be sent back to CMNDB2DD which will issue that message and terminate with RC=8.

Otherwise, on return from the exit, CMNDB2DD will re-read the SQL from the DDLIN ddname (i.e. including any changes made by the exit) and will continue to process the modified SQL sentence as directed by the other sysin parameters.

The 'data interface' to this exit is as follows. Shown here in COBOL and PL/I copybook format, and equivalent REXX variable names:

...

COBOL copybook

...

01 DB2D.
     ***
     * HLL DATA ITEMS FOR CMNDB2DD CALLED EXIT
     *** 
          03 DB2DGO                   PIC X(3).
     *                                           PROCEED? YES/NO 
          03 DB2DMSG                  PIC X(128).
     *                                           MESSAGE 
          03 DB2DACTN                 PIC X(8).
     *                                           CURRENT ACTION
          03 DB2DDB2S                 PIC X(4).
     *                                           DB2 SUBSYSTEM ID
          03 DB2DZMFI                 PIC X(4). 
     *                                           ZMF SUBSYSTEM ID 
          03 DB2DZPKG                 PIC X(10).
     *                                           ZMF PACKAGE 
          03 DB2DEXTN                 PIC X(8).
     *                                           EXTERNAL EXIT NAME 
          03 DB2DCMPN                 PIC X(8).
     *                                           COMPONENT 
          03 DB2DUSER                 PIC X(8).
     *                                           USERID 
          03 DB2DSLOC                 PIC X(128).
     *                                           SRC LOCN TEMPLATE 
          03 DB2DTLOC                 PIC X(128).
     *                                           TGT LOCN TEMPLATE 
          03 DB2DDLOC                 PIC X(128).
     *                                           DEPLOY FROM LOCATION 
          03 DB2DSCOL                 PIC X(128).
     *                                           SRC COLLID TEMPLATE 
          03 DB2DTCOL                 PIC X(128).
     *                                           TGT COLLID TEMPLATE 
          03 DB2DSSCM                 PIC X(128).
     *                                           SRC SCHEMA TEMPLATE 
          03 DB2DTSCM                 PIC X(128).
     *                                           TGT SCHEMA TEMPLATE 
          03 DB2DSAUT                 PIC X(128).
     *                                           SRC AUTHID TEMPLATE 
          03 DB2DTAUT                 PIC X(128).
     *                                           TGT AUTHID TEMPLATE 
          03 DB2DSQUL                 PIC X(128).
     *                                           SRC QUAL TEMPLATE 
          03 DB2DTQUL                 PIC X(128).
     *                                           TGT QUAL TEMPLATE 
          03 DB2DDQUL                 PIC X(128).
     *                                           DEPLOY QUAL 
          03 DB2DSOWN                 PIC X(128).
     *                                           SRC OWNER TEMPLATE 
          03 DB2DTOWN                 PIC X(128).
     *                                           TGT OWNER TEMPLATE 
          03 DB2DDOWN                 PIC X(128).
     *                                           DEPLOY OWNER 
          03 DB2DSWLM                 PIC X(54).
     *                                           SRC WLM TEMPLATE 
          03 DB2DTWLM                 PIC X(54).
     *                                           TGT WLM TEMPLATE 

...

PL/I copybook

...

/*THE API DATA AREA MAP FOLLOWS */
   DCL 1 DB2D,
         2 DB2DGO      CHAR(3),         /*PROCEED? YES/NO      */
         2 DB2DMSG     CHAR(128),       /*MESSAGE              */
         2 DB2DACTN    CHAR(8),         /*CURRENT ACTION       */
         2 DB2DDB2S    CHAR(4),         /*DB2 SUBSYSTEM ID     */
         2 DB2DZMFI    CHAR(4),         /*ZMF SUBSYSTEM ID     */
         2 DB2DZPKG    CHAR(10),        /*ZMF PACKAGE          */
         2 DB2DEXTN    CHAR(8),         /*EXTERNAL EXIT NAME   */
         2 DB2DCMPN    CHAR(8),         /*COMPONENT            */
         2 DB2DUSER    CHAR(8),         /*USERID               */
         2 DB2DSLOC    CHAR(128),       /*SRC LOCN TEMPLATE    */
         2 DB2DTLOC    CHAR(128),       /*TGT LOCN TEMPLATE    */
         2 DB2DDLOC    CHAR(128),       /*DEPLOY FROM LOCATION */
         2 DB2DSCOL    CHAR(128),       /*SRC COLLID TEMPLATE  */
         2 DB2DTCOL    CHAR(128),       /*TGT COLLID TEMPLATE  */
         2 DB2DSSCM    CHAR(128),       /*SRC SCHEMA TEMPLATE  */
         2 DB2DTSCM    CHAR(128),       /*TGT SCHEMA TEMPLATE  */
         2 DB2DSAUT    CHAR(128),       /*SRC AUTHID TEMPLATE  */
         2 DB2DTAUT    CHAR(128),       /*TGT AUTHID TEMPLATE  */
         2 DB2DSQUL    CHAR(128),       /*SRC QUAL TEMPLATE    */
         2 DB2DTQUL    CHAR(128),       /*TGT QUAL TEMPLATE    */
         2 DB2DDQUL    CHAR(128),       /*DEPLOY QUAL          */
         2 DB2DSOWN    CHAR(128),       /*SRC OWNER TEMPLATE   */
         2 DB2DTOWN    CHAR(128),       /*TGT OWNER TEMPLATE   */
         2 DB2DDOWN    CHAR(128),       /*DEPLOY OWNER         */
         2 DB2DSWLM    CHAR(54),        /*SRC WLM TEMPLATE     */
         2 DB2DTWLM    CHAR(54);        /*TGT WLM TEMPLATE     */

REXX variable names

...

proceed
messageText
currentAction
db2Subsystem
zmfSubsystemId
zmfPackage
externalName
component
userId
srcLocationTemplate
tgtLocationTemplate
deployFromLocation
srcCollIdTemplate
tgtCollIdTemplate
srcSchemaTemplate
tgtSchemaTemplate
srcAuthIdTemplate
tgtAuthIdTemplate
srcQualifierTemplate
tgtQualifierTemplate
deployQualifier
srcOwnerTemplate
tgtOwnerTemplate
deployOwner
srcWlmTemplate
tgtWlmTemplate

...

REXX Rample

...

Sample REXX showing the changing of the version to be the package id:
/* REXX            */
/*   */
/* Show all CMNDB2DD API fields */
/* Show DDL/SQL on input */
/* Change the version to be the ZMF package id */
/* Show DDL/SQL passed back to CMNDB2DD */
/*   */

proceed = "YES"

say " "
say "---------------------------------------------------"
say " CMNDB2DD HLLX "
say "---------------------------------------------------"
say " "
say "currentAction        : "currentAction
say "db2Subsystem         : "db2Subsystem
say "zmfSubsystemId       : "zmfSubsystemId
say "zmfPackage           : "zmfPackage
say "externalName         : "externalName
say "component            : "component
say "srcLocationTemplate  : "srcLocationTemplate
say "tgtLocationTemplate  : "tgtLocationTemplate
say "deployFromLocation   : "deployFromLocation
say "srcCollIdTemplate    : "srcCollIdTemplate
say "tgtCollIdTemplate    : "tgtCollIdTemplate
say "srcSchemaTemplate    : "srcSchemaTemplate
say "tgtSchemaTemplate    : "tgtSchemaTemplate
say "srcAuthIdTemplate    : "srcAuthIdTemplate
say "tgtAuthIdTemplate    : "tgtAuthIdTemplate
say "srcQualifierTemplate : "srcQualifierTemplate
say "tgtQualifierTemplate : "tgtQualifierTemplate
say "deployQualifier      : "deployQualifier
say "srcOwnerTemplate     : "srcOwnerTemplate
say "tgtOwnerTemplate     : "tgtOwnerTemplate
say "deployOwner          : "deployOwner
say "srcWlmTemplate       : "srcWlmTemplate
say "tgtWlmTemplate       : "tgtWlmTemplate
say " "
"execio * diskr DDLIN (stem ddl. finis"

say " "
say "+-----------------------------------------+"
say "| DDL/SQL as supplied to HLL exit follows |"
say "+-----------------------------------------+"
say " "
Do i = 1 to ddl.0
  Say ">"ddl.i"<"
End

Do i = 1 to ddl.0

  ix = pos('VERSION ',ddl.i)
  if ix = 0 then iterate

  ix = ix + 8
  endofit = substr(ddl.i,ix)
  versn   = subword(endofit,1,1)
  pastver = subword(endofit,2)
 replace  = substr(ddl.i,1,ix-1) || zmfPackage || " " || pastver || '25'x
  ddl.i = replace

End

...

messageText = "VERSION has been set to package id."
"execio * diskw DDLIN (stem ddl. finis"

say " "
say "+-----------------------------------------+"
say "| DDL/SQL as modified by HLL exit follows |"
say "+-----------------------------------------+"
say " "
Do  i = 1 to ddl.0
  Say ">"ddl.i"<"
End


exit 0

...