Alternate ID Swapping for DB2 Binds, Under CA Endevor Change Manager
//***************************************************************
//* BUILD A CLIST TO OPEN/CLOSE LGNT$$$ FILES AND DO THE BIND *
//***************************************************************
//BINDCLST EXEC PGM=IEBGENER,MAXRC=4
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&C1USERID..&C1ELEMENT..BIND(BINDCLST),
// DISP=(NEW,PASS,DELETE),
// SPACE=(TRK,(1,1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSUT1 DD *
PROC 0
CONTROL MSG
WRITE ** ALLOCATING FILES
ALLOC FILE(LGNT$$$I) DUMMY
ALLOC FILE(LGNT$$$O) DUMMY
WRITE ** SWAP ID TO ALTERNATE
OPENFILE LGNT$$$I
WRITE ** BIND PLAN USING ALTERNATE ID DSN SYSTEM(DSN6)
BIND PLAN(SQLASM01) MEM(SQLASM01) VAL(RUN) ACT(REP) ISO(RR) END
WRITE ** OPEN AND SWAP ID BACK TO USERS ORIGINAL ID
CLOSFILE LGNT$$$I
OPENFILE LGNT$$$O
CLOSFILE LGNT$$$O
FREE FILE(LGNT$$$I)
FREE FILE(LGNT$$$O)
/*
//* Change SQLASM01 by plan name (Use &C1ELEMENT or other symbolic)
//*****************************************************************
//* BIND APPLICATION PLAN IF EXECUTING IN FOREGROUND *
//* NOTE: ATTEMPTING TO RUN THIS STEP IN BG WILL RESULT IN RC=5 *
//*****************************************************************
//BINDFG EXEC PGM=BC1PTMP0,MAXRC=5,COND=(4,LT),
// PARM='&C1USERID..&C1ELEMENT..BIND(BINDCLST)'
//STEPLIB DD DSN=&DB2LOAD,DISP=SHR
//DBRMLIB DD DSN=&DBRMLIB,DISP=SHR
//SYSUDUMP DD SYSOUT=&SYSOUT
//*****************************************************************
//* BIND APPLICATION PLAN IF EXECUTING IN BACKGROUND *
//*****************************************************************
//BINDBG EXEC PGM=IKJEFT1B,COND=(5,NE,BINDFG),MAXRC=7
//* IKJEFT1B WILL PASS DB2 RETURN CODES BACK TO THE CALLER
//STEPLIB DD DSN=&DB2LOAD,DISP=SHR
//DBRMLIB DD DSN=&DBRMLIB,DISP=SHR
//SYSPROC DD DSN=&C1USERID..&C1ELEMENT..BIND,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
%BINDCLST
//*