Bellow is my ESP code and job JCL I am trying to get fix. Need some assistance and advice
CODE description
JOBA.10MIN TASK will trigger JCL JOBA every 10 min while RESOURCE ADD(0,RIZ_TCRASCE_INFILE). I coded REXX JOBONCSF in the JOBA.10MIN TASK to check job DATA1 & DATA2 PNODE = complete so that it will assign value "SWITCH1 ='Y'" & "SWITCH2 ='Y'" .
JOBA JCL will have if statement to check SWITCH1 and SWITCH2 value in the %INCLUDE steps as per code bellow.
Problem description
JOBA.10MIN TASK executed without any of the value SWITCH1 and SWITCH2 = 'Y' pass to the JOBA even when JOB DATA1 and JOB DATA2 completed.
I added the display after REXXOFF statement and can see both value populated with 'Y' correctly but JOBA not able to pick up the value of both SWITCH1 and SWITCH2.
My experience coding ESP just few weeks old so I have no idea how to fixed this . Appreciate any help and suggestion . Thank you in advance for any help.
ESP Portion
APPL TEST
JOB JOBA
SUBAPPL TEST01 WAIT
RUN TODAY
ENDJOB
DSTRIG DATA1
DSNAME 'ORMA001.TEST1.DATA' ANYCLOSE
SUBAPPL TEST01 WAIT
RUN TODAY
RELEASE ADD(TCRASCE.STATON)
ENDJOB
DSTRIG DATA2
DSNAME 'ORMA001.TEST2.DATA' ANYCLOSE
SUBAPPL TEST01 WAIT
RUN TODAY
RELEASE ADD(TCRASCE.STATON)
ENDJOB
/* TURNS RESOURCE RIZ_TCRASCE_INFILE ON
JOB TCRASCE.STATON LINK PROCESS
RUN TODAY
ESP RESDEF RIZ_TCRASCE_INFILE SET AVAIL(1)
ENDJOB
/* USE A TASK TO DYNAMICALLY INSERT TWGASCS2.
/* BUILD TIME QUALIFIER AND INSERT JOB TWGASCS2.T%TIME
JOB JOBA.10MIN TASK
RUN TODAY
REXXON PROC
J = JOBONCSF('DATA*','X')
SAY 'NUMBER 'J' JOBS'
DO I= 1 TO J
IF XPNODE.I ='COMPLETE' & XAPPLG.I = CLANGVAR('%ESPAPGEN')+
THEN DO
SAY 'IN HERE'
IF XJOBN.I ='DATA1' THEN DO
SAY 'JOBNAME1' XJOBN.I
SAY 'PNODE1' XPNODE.I
"SWITCH1 ='Y'"
END
IF XJOBN.I ='DATA2' THEN DO
SAY 'JOBNAME2' XJOBN.I
SAY 'PNODE2' XPNODE.I
"SWITCH2 ='Y'"
END
END
END
REXXOFF
SE 'SWITCH1 = %SWITCH1 ' U(O) /* to display the SWITCH1 value
SE 'SWITCH2 = %SWITCH2 ' U(O) /* to display the SWITCH2 value
TIME='%ESPAHH%ESPAMN%ESPASS'
ESP AJ JOBA.T%TIME INSERT APPL(%ESPAPPL..%ESPAPGEN)
REEXEC AT('REALNOW PLUS 10 MINUTE') NOMAXIMUM
RESOURCE ADD(0,RIZ_TCRASCE_INFILE)
ENDJOB
/* STOP SUBMISSION OF TWGASCS2 BY COMPLETING THE TASK
/*
JOB TWGASCS2.STOPSUB TASK SELFCOMPLETING
RUN TODAY
RESOURCE ADD(1,RIZ_TCRASCE_INFILE)
ESP AJ TWGASCS2.1MIN COMPLETE APPL(%ESPAPPL..%ESPAPGEN)
ENDJOB
JCL portion of JOBA
---------------------------
//JOBA JOB (,,'7826',0156),' TEST',
//*------------------------------------------------------------------*
//* IF SWITCH1 = Y *
//*------------------------------------------------------------------*
%INCLUDE IF(('%SWITCH1' EQ 'Y'))
//COPY02 EXEC PGM=IEBGENER
//SYSUT1 DD DUMMY
//SYSUT2 DD DSN=ORMA001.TEST.DATA1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
%ENDINCL
//*
%INCLUDE IF(('%SWITCH2' EQ 'Y'))
//COPY02 EXEC PGM=IEBGENER
//SYSUT1 DD DUMMY
//SYSUT2 DD DSN=ORMA001.TEST.DATA2,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
%ENDINCL
//*