Question regarding value assigment in JOBONCSF to be use JCL



Unicenter CA-7 Job Management: CA's workload automation tool for managing, visualizing, automating, optimizing applications

Question regarding value assigment in JOBONCSF to be use JCL

Postby msa4004 » Fri Feb 23, 2018 5:17 pm

Hi All,

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
//*
 
msa4004
 
Posts: 2
Joined: Fri Feb 23, 2018 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Question regarding value assigment in JOBONCSF to be use

Postby NicC » Fri Feb 23, 2018 7:18 pm

It is not clear at what point the job is submitted. It HAS to be AFTER the SWITCH values have been set AND written to the JCL library. Once the JCL has been submitted it is set in stone and cannot be altered.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Question regarding value assigment in JOBONCSF to be use

Postby msa4004 » Sat Feb 24, 2018 8:23 am

Thanks for the reply.

Sorry these should be the coding that I need help with please.
The purpose of the SWITCH1 & SWITCH2 is so that JOBA only execute step base on completion of DATA1 and DATA2 each time JOBA.10MIN TASK re-exec JOBA.

Need advice on how to make JOBA able to see and execute steps accordingly base on the assignment of SWITCH in JOBA.10MIN TASK

Thank you in advance for your time and patient



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  JOBA.
/* BUILD TIME QUALIFIER AND INSERT JOB JOBA.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 JOBA BY COMPLETING THE TASK
JOB JOBA.STOPSUB TASK SELFCOMPLETING
  RUN TODAY
  RESOURCE ADD(1,RIZ_TCRASCE_INFILE)
  ESP AJ JOBA.10MIN COMPLETE APPL(%ESPAPPL..%ESPAPGEN)
ENDJOB

 




JCL 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
//*
 
 
msa4004
 
Posts: 2
Joined: Fri Feb 23, 2018 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Question regarding value assigment in JOBONCSF to be use

Postby NicC » Sat Feb 24, 2018 4:41 pm

Please show the submitted job and any messages regarding it. It looks as though your jobcard is incomplete but what you show may not be what was submitted.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to CA-7

 


  • Related topics
    Replies
    Views
    Last post