Additional steps are able to be added to the hlq.CDBAMDL(MJBPMDL) member where some additional processing is needed.
Release : R20
DB2 for Z/OS
The default model JCL members are provided in the product library during installation. These members can be copied to another PDS and then customized as needed.
It is recommended not to customize the installed JCL members without maintaining an original copy as any customizations are not supported.
Member MJBPMDL contains automatic symbolic variables that are substituted using local installation values.
Additional steps can be added to the MJBPMDL member if required.
As others who use the same member library will be affected by any changes, either:
(1) create a new member in the library (eg MJBPMD2) (if you have the authority to update the hlq.CDBAMDL library)
or
(2) copy the entire CDBAMDL library into a brand new library & create a new MJBPMD2 member in it in order to preserve the original CDBAMDL member.
Don't change the installed MJBPMDL member in case someone else mistakes it for the original one.
This is what the customized model member could look like as an example. The parts in red have been added to the installed MJBPMDL member and a new member name MJBPMD2 used.
//STEP1 EXEC PGM=PTLDRIVM,REGION=4M,PARM='%SUFFIX.EP=BPLBCTL'
#INCLUDE STEPLIB
#INCLUDE PTILIB
#INCLUDE PTIPARM
//PTIXMSG DD DISP=SHR,DSN=%*XMSG1
//SYSOUT DD SYSOUT=*
//PTIIMSG DD SYSOUT=*
//PTISELDD DD SYSOUT=*,
// DCB=(LRECL=4092,RECFM=VB,BLKSIZE=4096) <=====adding a PTISELDD DD card will receive the SQL report from Batch Processor.
//UTPRINT DD SYSOUT=*
//ABNLIGNR DD DUMMY SUPPRESS ABENDAID DUMPS
//SYSUT1 DD UNIT=%GENUNIT,SPACE=(CYL,(30,30))
//SYSREC DD UNIT=%GENUNIT,SPACE=(TRK,(1,1))
#IF(%IPTISDSN)
//BPIIPT DD DISP=SHR,
// UNIT=%GENUNIT,%INVSER
// DSN=%INDSN
#ENDIF
//BPIOPT DD *
//*
//STEP2 EXEC PGM=IKJEFT01,DYNAMNBR=20 <==== STEP02 will run a standard DSNTEP2 job.
//*
//STEPLIB DD DSN=hlq.SDSNLOAD,DISP=SHR
//*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSTSIN DD *
DSN SYSTEM(ssid)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEPnn) -
LIB('ssid.RUNLIB.LOAD')
/*
//SYSIN DD DISP=SHR,DSN=hlq.SQL(SELECT) <====some SQL in here
//*
Afterwards, specify the new library on the Batch JCL Specification screen, before executing your job like so:
PTBMOD ---------- Batch JCL Specification --------- yyyy/mm/dd hh:mm:ss
COMMAND ===>
EXECUTION SPECIFICATIONS:
DESTINATION ===> P ( J - JES, D - Dataset, P - Preview JCL )
OUTPUT JCL DATA SET SPECIFICATIONS:
DATA SET NAME ===>
MEMBER NAME ===> ( Blank or pattern for member selection list )
VOLUME SERIAL ===> ( If not cataloged )
REPLACE MEMBER ===> Y ( Y - Yes, N - No )
MODEL JCL SPECIFICATIONS:
MODEL LIBRARY ===> 'your.hlq.MODEL'
MODEL MEMBER ===> MJBPMD2 ( Blank or pattern for member selection list )
VOLUME SERIAL ===> ( If not cataloged )
EDIT MODEL JCL ===> N ( Y - Yes, N - No )
UPDATE VALUES ===> N ( Y - Yes, N - No )
JOB CARD SPECIFICATION: Save changes made to JOB card? ===> Y ( Y, N )
==> //useridB JOB (accountno),'NEW MODEL',CLASS=x,MSGCLASS=x,
==> // NOTIFY=userid,REGION=0M,TIME=nnnn
==> //*
In the example below, a DSNTEP2 step is added to the MJBPMD2 member in the new model library.
STEP1 will simply run some SQL with Batch Processor.
STEP2 will run some SQL using DSNTEP2.
//useridB JOB (accountno),'My Job',CLASS=B,MSGCLASS=X, <===The job card is brought in by Batch Processor from the screen above.
// NOTIFY=userid,REGION=0M,TIME=1440
//*
//STEP1 EXEC PGM=PTLDRIVM,REGION=4M,PARM='SUFFIX=00,EP=BPLBCTL'
//STEPLIB DD DISP=SHR,DSN=HLQ.CDBALOAD
// DD DISP=SHR,DSN=HLQ.PRIVATE.SDSNEXIT
// DD DISP=SHR,DSN=HLQ.SDSNLOAD
//PTILIB DD DISP=SHR,DSN=HLQ.CDBALOAD
// DD DISP=SHR,DSN=HLQ.PRIVATE.SDSNEXIT
// DD DISP=SHR,DSN=HLQ.SDSNLOAD
//PTIPARM DD DISP=SHR,DSN=HLQ.CDBAPARM
//PTIXMSG DD DISP=SHR,DSN=HLQ.CDBAXMSG
//SYSOUT DD SYSOUT=*
//PTIIMSG DD SYSOUT=*
//PTISELDD DD SYSOUT=*,
// DCB=(LRECL=4092,RECFM=VB,BLKSIZE=4096)
//UTPRINT DD SYSOUT=*
//ABNLIGNR DD DUMMY SUPPRESS ABENDAID DUMPS
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(30,30))
//SYSREC DD UNIT=SYSDA,SPACE=(TRK,(1,1))
//BPIIPT DD DISP=SHR,
// DSN=HLQ.SQL(SELECT) <====some SQL in here
//BPIOPT DD *
.CONTROL BPID(HLQ.SQL-SELECT) +
LOGID(ssid) UNIT(SYSDA)
.LIST SYSOUT(X,,A)
.OPTION ERRORS NOSQLERRORS RETRY(10) NOBINDERRORS +
SQLFORMAT(SQL)
.CONNECT ssid
//*
//*
//STEP2 EXEC PGM=IKJEFT01,DYNAMNBR=20
//*
//STEPLIB DD DSN=HLQ.SDSNLOAD,DISP=SHR
//*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSTSIN DD *
DSN SYSTEM(ssid)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEPnn) -
LIB('ssid.RUNLIB.LOAD')
/*
//SYSIN DD DISP=SHR,DSN=HLQ.SQL(SELECT) <======Some SQL in here
//*
When the batch job is submitted these DD's will be seen in the SYSOUT:
DDname Stepname
JESMSGLG JES2 The Step summary of the job
JESJCL JES2 The Job JCL submitted
JESYSMSG JES2 The job execution messages
PTISELDD STEP1 The SQL Output report from Batch Processor showing the SQL statement executed and data records if selecting data.
SYSTSPRT STEP2 The run cards for DSNTEP2. No Data records.
SYSPRINT STEP2 The SQL Output Report from DSNTEP2 showing the results of the SQL being executed. Data records will be seen here if selecting data.
SYS00003 STEP1 The Batch Processor run cards, SQL and return codes from the SQL. No data records.
See also this knowledgebase article regarding PTISELDD : Batch Processor for Db2 for z/OS SQL output, audit messages or return codes written to a dataset