CA Workload Automation ESP Edition

Expand all | Collapse all

Question regarding value assigment in JOBONCSF to be use JCL JOB

Jump to Best Answer
  • 1.  Question regarding value assigment in JOBONCSF to be use JCL JOB

    Posted 02-19-2018 05:39 AM

    Hi All,

     

    Bellow is my sample ESP code and job JCL I am trying to get fix.

     

    CODE description

     

    JOB JOBA.10MIN TASK will trigger JOBA every 10 min while RESOURCE ADD(0,RIZ_TCRASCE_INFILE). I coded REXX JOBONCSF in the  JOB JOBA.10MIN TASK to check job DATA1 & DATA2  PNODE = complete so that it will assign "SWITCH1 ='Y'"  &      "SWITCH2 ='Y'"  which later be use in JOBA to execute the %INCLUDE step.

     

    Problem description

     JOB 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

     

     

    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(ORMA001) /* to display the SWITCH1 value
       SE 'SWITCH2    = %SWITCH2 ' U(ORMA001) /* 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

     

    JCL 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
    //*



  • 2.  Re: Question regarding value assigment in JOBONCSF to be use JCL JOB

    Posted 02-20-2018 10:54 AM

    Hi MSA,

     

    The variable assignments are under TASK JOBA.10MIN, so they can't be seen by other jobs like JOBA.

     

    Hope this helps,

     

    Lucy



  • 3.  Re: Question regarding value assigment in JOBONCSF to be use JCL JOB

    Posted 02-22-2018 08:28 AM

    Hi Lucy,

     

    I made changes to ESP coding to use global variables as bellow coding . I can see the Global value of SWITCH1 SWITHC2 changed to 'Y'

    in the global variable table screen. However  when   JOBA.10MIN TASK   reexcec JOBA still  failed to pick up the changed  global variable.

    I am stuck on this  . 

     

    Can you expertly advice me how to fix this. Thank you in advance for your time and patient.

     

    APPL TEST

     

    JOB JOBA

    SUBAPPL TEST01 WAIT

    RUN TODAY

    ENDJOB

     

    FLAG1 =''

    FLAG2 =''

     

    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
               "FLAG1 ='Y'"
              END
              IF XJOBN.I ='DATA2' THEN DO
               SAY 'JOBNAME2' XJOBN.I
               SAY 'PNODE2' XPNODE.I
               "FLAG2 ='Y'"
              END
          END
        END
       REXXOFF
       SWITCH1 = %FLAG1

       SWITCH2 = %FLAG2

       VPUT= (SWITCH1,SWITCH2)  TABLE (MYTABLE)
       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                      



  • 4.  Re: Question regarding value assigment in JOBONCSF to be use JCL JOB
    Best Answer

    Posted 03-05-2018 01:43 PM

    Hi MSA,

     

    Sorry that I missed your update. Not sure if you have figured it out.

     

    You will need to use VGET to retrieve the values from global variable table, like:

    VGET SWITCH1 TABLE (MYTABLE)

    VGET SWITCH2 TABLE (MYTABLE)

     

    Hope this helps,

     

    Lucy