Set your "PARMX" symbolic value however you need it to be set (for example, you may want to specify life cycle names instead of stage names). This example sets PARMX as a combination of subsystem and stage names:
//* For current Subsystem and Stage ID
// PARMX='&C1SUBSYS(4,1).&C1STAGE(3,1)',
If you need to back bind then you can add another set of these steps with additional symbolics for the prior stage(s).
After the DB2 bind options are retrieved they are validated before they are executed to remediate the risk of executing arbitrary TSO commands. This example assumes that the libraries containing the DBRM and the DB2 bind commands are local to both ENDEVOR and the partition where the DB2 binds are executed and that SYSAFF will execute the DB2 bind on the target partition. If this is not the case then you will need to add step(s) to transfer everything to the remote partition(s). This example assumes BIND PACKAGE, but BIND PLAN could also be supported with some modifications.
//*********************************************************************
//* 2 TRY TO RETRIEVE DB2 BIND PARAMETERS FOR CURRENT STAGE *
//* FOR THE PROGRAM ELEMENT *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//DB2PRME EXEC PGM=CONPARMX,
// MAXRC=0,
// PARM=(D&PARMX,,Z,Z,&C1ELEMENT,,'N','Y')
//PARMS DD DSN=&&DB2BIND,
// DISP=(OLD,PASS)
++INCLUDE ##PARMX
//*********************************************************************
//* 3 CHECK IF DB2 PARAMETERS WERE RETRIEVED *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//PRMCHKE EXEC PGM=IDCAMS,
// MAXRC=4
//SYSUDUMP DD DUMMY
//SYSOUT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//SYSPRINT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//FILEIN DD DSN=&&DB2BIND,
// DISP=(SHR,PASS)
//SYSIN DD *
PRINT INFILE(FILEIN) CHARACTER COUNT(1)
/*
// IF (PRMCHKE.RC EQ 4) THEN
//* IF DB2 PARAMETERS NOT RETRIEVED *
//*********************************************************************
//* 4 TRY TO RETRIEVE DB2 BIND OPTIONS FOR CURRENT STAGE *
//* FOR THIS PROCESSOR GROUP *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//DB2PRMP EXEC PGM=CONPARMX,
// MAXRC=0,
// PARM=(D&PARMX,,$$$$DFLT,&C1PRGRP,Z,,'N','Y')
//PARMS DD DSN=&&DB2BIND,
// DISP=(OLD,PASS)
++INCLUDE ##PARMX
//*********************************************************************
//* 5 CHECK IF DB2 PARAMETERS WERE RETRIEVED *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//PRMCHKP EXEC PGM=IDCAMS,
// MAXRC=4
//SYSUDUMP DD DUMMY
//SYSOUT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//SYSPRINT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//FILEIN DD DSN=&&DB2BIND,0
/ DISP=(SHR,PASS)
/SYSIN DD *
PRINT INFILE(FILEIN) CHARACTER COUNT(1)
/*
//*********************************************************************
//* 6 VALIDATE THE DB2 BIND PARAMETERS, CREATE CLIST *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//VALIDBND EXEC PGM=IKJEFT01,
// MAXRC=4,
// PARM='%DB2BVAL &C1STAGE &DB2DSG &LPAR &C1ELEMENT'
//SYSTSIN DD DSN=&&DB2BIND,
// DISP=(SHR,PASS)
//SYSPRINT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//SYSTSPRT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//SYSEXEC DD DSN=name of REXX library,
// DISP=SHR
//BINDOUT DD DSN=&#HLQ..&MIDLVL..DB2BIND(&C1ELEMENT),
// DISP=OLD
// IF (VALIDBND.RC = 0) THEN
//* IF DB2 PARAMETERS WERE VALIDATED *
//*********************************************************************
//* 7 SUBMIT DB2 BIND FOR CURRENT STAGE *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//DB2BIND EXEC PGM=IEBGENER,
// MAXRC=4
//SYSIN DD DUMMY
//SYSPRINT DD DUMMY
//SYSUT1 DD DATA,DLM='/>'
//&C1USERID(1,5)D JOB &account,'&pgmfield',
// MSGCLASS=&MSGCLASS,CLASS=&CLASS
/*JOBPARM SYSAFF=&LPAR
//*
//*********************************************************************
//* EXECUTE DB2 BIND CLIST IN BACKGROUND FOR CURRENT *
//* STAGE *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//BINDBG EXEC PGM=IKJEFT1A
//STEPLIB DD DSN=&DSNEXIT,
// DISP=SHR
// DD DSN=&DSNLOAD,
// DISP=SHR
//SYSPROC DD DSN=&#HLQ..&MIDLVL..DB2BIND,
// DISP=OLD
//SYSTSIN DD *
&C1ELEMENT
/*
//DBRMLIB DD DSN=&#HLQ..&MIDLVL..DBRM,
// DISP=SHR
//SYSTSPRT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//SYSPRINT DD SYSOUT=&SYSOUT,
// FREE=CLOSE
//SYSUDUMP DD SYSOUT=&SYSOUT,
// FREE=CLOSE
/>
//SYSUT2 DD SYSOUT=(&INTRDR,INTRDR),
// FREE=CLOSE,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=3120)
The Type PARMX program elements can contain the DB2 options for one or more DB2 binds provided the validation REXX, which also creates the DB2 BIND CLIST, is coded to recognize the start of each DB2 bind. MEMBER() is appended to each BIND by the validation REXX exec:
Dsubstg = 'BIND PACKAGE(collection1) - '+
'QUALIFIER(qualifier1) VALIDATE(BIND) - '+
'BIND PACKAGE(collection2) - '+
'QUALIFIER(qualifier12) VALIDATE(BIND) - '
Original Message:
Sent: 08-06-2019 05:48 AM
From: Aneesh Y G
Subject: Endevor and DB2 Binds
Mathew,
Could you please elaborate the above idea of using CONPARMX for building DB2 Binds cards with the sample step.
Thanks!!
Original Message:
Sent: 07-25-2019 02:24 PM
From: Mathew Goldstein
Subject: Endevor and DB2 Binds
We are using CONPARMX to define the DB2 bind options for each processor group, we match the DB2 BIND options name with a subsystem and stage identifier, for example something like D&C1SUBSYSTEM&C1STAGEID. Ideally, there will be a DB2 object naming standard and the only character(s) that would change from stage to stage would be the lifecycle indicator character(s).