Configuring DB2 for stored procedure linkage

Here are details on configuring DB2® when remote access of code on z/OS® involves a stored procedure linkage. The linkage is in effect when the calllink element, remoteComType attribute value is STOREDPROCEDURE.

Workload manager

You must create a dedicated WLM for IMS™ debugging. Rational® COBOL Runtime for zSeries provides sample JCL to do this in ELA.V6R0M1.SELASAMP(ELADBWLM). Edit the JCL and change the STEPLIB to match your system configuration. Ensure that the STEPLIB contains the PDS(s) that contain the called programs that you need to access. When configuring for DLI debugging, also ensure that the STEPLIB contains the PDS in which you created the EGL version of the AIBTDLI and CBLTDLI load modules. The following listing shows the sample JCL:
//ELADBWLM PROC RGN=0K,APPLENV=ELADBWLM,DB2SSN=#db2ssn,NUMTCB=8
//*
//SYMBOLS INCLUDE MEMBER=$INCLUDE
//*
//IEFPROC  EXEC PGM=DSNX9WLM,REGION=&RGN;,TIME=NOLIMIT,DYNAMNBR=10,
//         PARM='&DB2SSN;,&NUMTCB;,&APPLENV;'
//STEPLIB  DD DISP=SHR,DSN=#db2.SDSNEXIT
//         DD DISP=SHR,DSN=#db2.SDSNLOAD
//         DD DISP=SHR,DSN=#cee.SCEERUN
//         DD DISP=SHR,DSN=ELA.V6R0M1.SELALMD
//         DD DISP=SHR,DSN=#cobol.SIGYCOMP
//         DD DISP=SHR,DSN=&HLQTCP..SEZATCP;
//ELAPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//CEEDUMP  DD SYSOUT=*
//SYSMDUMP DD SYSOUT=*
//SYSABEND DD DUMMY
//********************************************************************
//* WORKFILES FOR COMPILERS AND BINDER
//********************************************************************
//SYSUT1   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT3   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT4   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT5   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT6   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT7   DD UNIT=SYSDA,SPACE=(CYL,(1,1))

DB2 stored procedure definition

You need an SQL stored procedure to access a database on the host for EGL debugging. You must also grant access to this stored procedure for all users. Rational COBOL Runtime for zSeries provides the following sample SQL statements in the following members of ELA.V6R0M1.SELASAMP:
EZESP1CR
Provides sample SQL statements for creating the stored procedure
EZESP1GR
Provides sample SQL statements for granting authority to the stored procedure
CREATE PROCEDURE <schema>.EZESP1 ( IN VAR01 INT,
                                 IN VAR02 INT,
                                 INOUT VAR03 VARCHAR(32672) FOR BIT DATA,
                                 INOUT VAR04 BLOB(524288) )
    EXTERNAL NAME EZESP1
    LANGUAGE COBOL
    PARAMETER STYLE GENERAL
    NOT DETERMINISTIC
    COLLID <collid>
    WLM ENVIRONMENT <eladbwlm>
    RUN OPTIONS 'ALL31(OFF) STACK(,,BELOW)'
Change the following placeholders to values that are appropriate to your system:
<schema>
The schema where the stored procedure is to be installed.
<collid>
The collection ID for your system.
<eladbwlm>
The name of the workload manager that you specified earlier.
You can also change the default stored procedure name, EZESP1, to any name in the CREATE statement. However, do not change the EXTERNAL NAME. In addition, if you change the default stored procedure name, be sure that you do both of the following things:
  • Change the procedure name in SQL GRANT command.
  • If you are using the EGL Debugger, specify the new stored procedure name in your Debug preferences: Window > Preferences > EGL > Debug > Debug IMS DLI
The stored procedure EZESP1GR.sql grants all users access to EZESP1CR.sql:
GRANT EXECUTE ON PROCEDURE <schema>.EZESP1 TO PUBLIC

Change <schema> to match the schema that you specified when you created the stored procedure. In addition, if you changed the SQL name when you created the stored procedure, you must change it here as well.


Feedback