I had to do the DB2 binds for MQ as part of a new QSG, and I thought I would document some of the customising I did to make it easier to use the DB2 customisation in MQ
JCL around DB2 jobs.
There are several ways of tailoring the JCL for the DB2 jobs provided by MQ.
These jobs have JCL provided at the top with JCL comments giving instructions on how to customer the member.
//CSQ45BPK JOB //****************************************************************** //* * //* @START_COPYRIGHT@ * //* Statement: Licensed Materials - Property of IBM * ... //* CUSTOMIZE THIS JCL HERE FOR YOUR INSTALLATION //* YOU MUST DO GLOBAL CHANGES ON THESE PARAMETERS USING YOUR EDITOR //* * //* Replace ++DB2QUAL++ //* with the high level qualifier of the //* DB2 target library data sets. ... //BINDPLAN EXEC PGM=IKJEFT01,REGION=4M,DYNAMNBR=20 //STEPLIB DD DSN=++DB2QUAL++.SDSNLOAD,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTSPRT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(++DB2SSID++)
The first step is to copy the CSQ45* jobs from the installation SCSQPROC library to your team library so you can edit them without changing the original.
The first way of customising the members
Follow the knowledge centre!
For each member follow the instructions like
//* Replace ++DB2QUAL++
//* with the high level qualifier of the
//* DB2 target library data sets.
This means making the same changes in multiple members. I got bored after the second time....
The second way
- Take the first job, customise the JCL once, create a member with this JCL, for example create MQDB2JCL.
- For the next job follow the instructions in the JCL comments to customise the DB2 statements.
- Delete all of the JCL,
- Copy MQDB2JCL into the member
The third way
Create a member with JCL, and other members with the DB2 statements it
- Create a JCL file and use //SYSIN DD or //SYSTSIN DD to point to the DB2 members.
- Edit the CSQ45* member
- Follow the instructions in the JCL comments to customise the DB2 statements.
- Delete the JCL from the DB2 member
My job finally looked like
//PAICEDB0 JOB 1,MSGCLASS=H,GROUP=SCENU
//CREATESG EXEC PGM=IKJEFT01,REGION=4M,DYNAMNBR=20
//STEPLIB DD DISP=SHR,DSN=SYS2.DB2.V12.SDSNLOAD
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
RUN PROGRAM(DSNTIAD) -
//SYSIN DD *
SET CURRENT SQLID='SCENU';
//* DELETE THE STORAGE GROUP
//* DD DISP=SHR,DSN=SCEN.DB2.JCL(CSQ4XDSG)
//* CREATE THE STORAGE GROUP
//* DD DISP=SHR,DSN=SCEN.DB2.JCL(SQ3CSG)
//* DELETE THE DATABASE
//* DD DISP=SHR,DSN=SCEN.DB2.JCL(SQ3DDB)
//* CREATE THE DATABASE
//* DD DISP=SHR,DSN=SCEN.DB2.JCL(CSQ4XCDB)
//* DELETE THE TABLE SPACES
//* DD DISP=SHR,DSN=SCEN.DB2.JCL(CSQ4XDTS)
//* CREATE THE TABLE SPACES
// DD DISP=SHR,DSN=SCEN.DB2.JCL(CSQ4XCTS)
//* CREATE THE TABLES
// DD DISP=SHR,DSN=SCEN.DB2.JCL(CSQ4XCTB)
The lines beginning with //* are comments, so the only member used was CSQ4XCTB
This way it is very clear which JCL members I need to include to define (and delete) the DB2 objects.
My tailored member CSQ4XCTB starts
CREATE TABLE CSQ.ADMIN_B_QSG
QSGNAME CHAR(4) NOT NULL,
This way of configuring the JCL means it is easier to duplicate it for test/production systems.
This applies to all of the DB2 configuration files CSQ45* (CSQ4* are samples, the 5 is the DB2 component).
So this applies to
CSQ45AQM, CSQ45AQS, CSQ45BPK, CSQ45BPL, CSQ45CDB, ,CSQ45CSG, CSQ45CTB, CSQ45CTS, CSQ45DDB, CSQ45DSG, CSQ45DTB, CSQ45DTS, CSQ45GEX, CSQ45MQS, CSQ45RQM, CSQ45RQS, CSQ45STB, CSQ45VER, CSQ456TB, CSQ4570T, CSQ4571T,