ESP Workload Automation

Expand all | Collapse all
  • 1.  Templates

    Posted Jun 26, 2018 01:34 PM

    I have a question around a template I am creating. When I simulate it's not picking up ESPUSR(PRDRD01) and I think it's because of the = sign in the IF statement, any ideas?

     

    TEMPLATE $MOBIUS (1 JOBNAME ESPUSR(PRDRD01) +          

    CCCHK1(PROC(REPTPROC) RC(0:12) OK CONTINUE) +          

    CCCHK2(PROC(BACKUP) RC(0:12) OK CONTINUE) +            

    RESOURCE1(ADD(0001,INITIATOR_A)) +                     

    RESOURCE2(ADD(0001,MOBIUS_JOB_RESOURCE)) RUN(TODAY))   

                                                           

    APP='%JOBNAME(1:2)'                                    

                                                           

    JOB %JOBNAME                                            

      IF ESPUSR NE "" THEN ESPUSR=%ESPUSR                  

      IF CCCHK1 NE "" THEN CCCHK %CCCHK1                   

      IF CCCHK2 NE "" THEN CCCHK %CCCHK2                   

      RESOURCE ADD(0001,%APP._INFOPAC)                     

      IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE1          

      IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE2          

      RUN %RUN                                             

    ENDJOB                                                 

     

    Here’s part of the simulation and if you notice it does not substitute ESPUSR.

     

    JOB VI304EM1                              

    IF ESPUSR NE "" THEN ESPUSR=%ESPUSR       

    IF CCCHK1 NE "" THEN CCCHK %CCCHK1        

    CCCHK PROC(REPTPROC) RC(0:12) OK CONTINUE 

    IF CCCHK2 NE "" THEN CCCHK %CCCHK2        

    CCCHK PROC(BACKUP) RC(0:12) OK CONTINUE   

    RESOURCE ADD(0001,VI_INFOPAC)             

    IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE1

    RESOURCE ADD(0001,INITIATOR_A)            

    IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE2

    RESOURCE ADD(0001,MOBIUS_JOB_RESOURCE)    

    RUN TODAY                                 

    ENDJOB           

     

    Any ideas?


    Thanks,

    Sharon



  • 2.  Re: Templates

    Posted Jun 26, 2018 01:57 PM

    FWIW - I have rarely been able to get an application that uses a template to simulate correctly.  I have resorted to just triggering them and watching for console messages or "bad behavior"



  • 3.  Re: Templates

    Posted Jun 26, 2018 02:49 PM

    How many parameters are passed to the template?
    1 - JOBNAME or

    2 - JOBNAME and ESPUSR(PRDRD01)

     

    TEMPLATE $MOBIUS (1 JOBNAME ESPUSR(PRDRD01) +   

     

    In the Template statement you have 1 for the number of positional parameters, but show 2 JOBNAME and ESPUSER???

     

    TEMPLATE $MOBIUS (2 JOBNAME, ESPUSR(PRDRD01) +  

    Where is the ENDTEMPL statement?

     

    After the template is defined when do you call it and pass the values for the positional parameter(s)?



  • 4.  Re: Templates

    Posted Jun 26, 2018 03:26 PM

    The goal is to only pass 1 parameter unless we need to override others. Example below.

     

    $MOBIUS VI304EM1

     

    The ENDTEMPL statement is there it may have got cut off on original post.

     

    TEMPLATE $MOBIUS (1 JOBNAME ESPUSR(PRDRD01) +
    DATASET(D675.CMN.SHRD.JCL.PROD) +
    CCCHK1(PROC(REPTPROC) RC(0:12) OK CONTINUE) +
    CCCHK2(PROC(BACKUP) RC(0:12) OK CONTINUE) +
    RESOURCE1(ADD(0001,INITIATOR_A)) +
    RESOURCE2(ADD(0001,MOBIUS_JOB_RESOURCE)) RUN(TODAY))

    APP='%JOBNAME(1:2)'

    JOB %JOBNAME
    IF ESPUSR NE "" THEN ESPUSR='%ESPUSR'
    IF DATASET NE "" THEN DATASET %DATASET
    IF CCCHK1 NE "" THEN CCCHK %CCCHK1
    IF CCCHK2 NE "" THEN CCCHK %CCCHK2
    RESOURCE ADD(0001,%APP._INFOPAC)
    IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE1
    IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE2
    RUN %RUN
    ENDJOB

    ENDTEMPL



  • 5.  Re: Templates

    Posted Jun 26, 2018 03:41 PM

    If there is 1 parameter shouldn't there be a closing parentheses ")" after JOBNAME?

     

    TEMPLATE $MOBIUS (1 JOBNAME) ESPUSR(PRDRD01) +



  • 6.  Re: Templates

    Posted Jun 26, 2018 03:46 PM
      |   view attached

    I don’t think so as the template works, only having an issue with ESPUSR and simulation. When I simulate I don’t see it pass the ESPUSR like it does all the other parameters in the template.

     

    Thanks,

    Sharon



  • 7.  Re: Templates

    Posted Jun 26, 2018 05:17 PM

    Hi All, 

    I thought I would join in. The TEMPLATE statement needs to be a 2 if there are 2 parameters. Below is a simplified example.  

    I am not sure what the rest of the line after the ESPUSR(PRDRD01) + ......... is supposed to be. These would normally be variables that are populated from the values specified after ENDTEMPL statement. 


    TEMPLATE MULTIRUN (4, QUAL, AGENTNAME, PATH, SCRIPT1)

    UNIX_JOB A.%QUAL
    RUN ANY
    AGENT %AGENTNAME,
    SCRIPTNAME /%PATH/%SCRIPT1
    ARGS 2
    ENDJOB


    ENDTEMPL
    MULTIRUN 1 AGENTU_01 pathA SLEEP1
    MULTIRUN 2 AGENTU_01 pathB SLEEPA

     

    Let me know if you have any questions. 



  • 8.  Re: Templates

    Posted Jun 27, 2018 07:14 AM

    Here is the template. The only parameter that has to be passed is the JOBNAME. Everything simulates fine except it doesn’t show the value for ESPUSR.

     

    TEMPLATE $MOBIUS (1 JOBNAME ESPUSR(PRDRD01) +

    DATASET(D675.CMN.SHRD.JCL.PROD) +

    CCCHK1(PROC(REPTPROC) RC(0:12) OK CONTINUE) +

    CCCHK2(PROC(BACKUP) RC(0:12) OK CONTINUE) +

    RESOURCE1(ADD(0001,INITIATOR_A)) +

    RESOURCE2(ADD(0001,MOBIUS_JOB_RESOURCE)) RUN(TODAY))

     

    APP='%JOBNAME(1:2)'

     

    JOB %JOBNAME

      IF ESPUSR NE "" THEN ESPUSR='%ESPUSR'

      IF DATASET NE "" THEN DATASET %DATASET

      IF CCCHK1 NE "" THEN CCCHK %CCCHK1

      IF CCCHK2 NE "" THEN CCCHK %CCCHK2

      RESOURCE ADD(0001,%APP._INFOPAC)

      IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE1

      IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE2

      RUN %RUN

    ENDJOB

    ENDTEMPL

     

    Here’s part of the simulation and if you notice it does not substitute ESPUSR but everything else is substituted properly.

     

    JOB VI304EM1

    IF ESPUSR NE "" THEN ESPUSR=%ESPUSR

    IF CCCHK1 NE "" THEN CCCHK %CCCHK1

    CCCHK PROC(REPTPROC) RC(0:12) OK CONTINUE

    IF CCCHK2 NE "" THEN CCCHK %CCCHK2

    CCCHK PROC(BACKUP) RC(0:12) OK CONTINUE

    RESOURCE ADD(0001,VI_INFOPAC)

    IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE1

    RESOURCE ADD(0001,INITIATOR_A)

    IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE2

    RESOURCE ADD(0001,MOBIUS_JOB_RESOURCE)

    RUN TODAY

    ENDJOB

     

    Thanks,

    Sharon



  • 9.  Re: Templates

    Posted Jun 27, 2018 09:20 AM

    Ya lern something new every day.  The method used above is described in the manual and allows the template to have defaults.  It is kind of cool. Below is an example from the manual.  So far I have not been able to get it to work with the ESPUSR= statement. 

     

    In this case FREQ defaults to DAILY unless it is defined in the PAY Statement after the ENDTEMPL. 

     

    APPL PAYROLL

    JCLLIB 'CYBER.JCLLIB.CNTL'

    TEMPLATE PAY (1 JOBNAME FREQ(DAILY) NEXT())

      JOB %JOBNAME

        IF FREQ NE "" THEN RUN %FREQ

        IF NEXT NE " "  THEN RELEASE (%NEXT)

        TAG PJOB

      ENDJOB

    ENDTEMPL

    PAY PAYJOB1 NEXT(PAYJOB2,PAYJOB3)

    PAY PAYJOB2 NEXT(PAYJOB4)

    PAY PAYJOB3 FREQ(WEEKDAYS) NEXT(PAYJOB4)

    PAY PAYJOB4 NEXT(PAYJOB5)

    PAY PAYJOB5 FREQ(LAST WORKDAY OF MONTH)



  • 10.  Re: Templates

    Posted Jun 27, 2018 09:38 AM

    It is pretty cool the way this works and I’m really wanting to figure out the ESPUSR= part of this but so far no luck my way either, I’ll keep beating at it a bit and then I may just have to surrender to it.



  • 11.  Re: Templates

    Posted Jun 27, 2018 09:44 AM

    One thing I tried was to have the variable contain the whole string like the one below. This didn't work either. 

    ESPUSR(USR='XXXX')



  • 12.  Re: Templates

    Posted Jun 27, 2018 09:54 AM

    I tried something similar as well and my results were the same, no can do.



  • 13.  Re: Templates
    Best Answer

    Broadcom Employee
    Posted Jun 27, 2018 10:16 AM

    Hi Sharon,

     

    Could you add ECHO %ESPUSR to test it out?

     

    I believe that the variables on the right of the assignment are not resolved in simulation. I even tested for a simpler one:

    TEST='%ESPSDDD' 

     

    And %ESPSDDD is not resolved either.

     

    Thanks,

     

    Lucy



  • 14.  Re: Templates

    Posted Jun 27, 2018 10:20 AM

    FYI.....

    I tried it with TAG %ESPUSER and it works OK...... 



  • 15.  Re: Templates

    Posted Jun 27, 2018 10:23 AM

    Lucy said this…

     

    I believe that the variables on the right of the assignment are not resolved in simulation so she had me ECHO the variable and it does resolve.

     

    $MOBIUS VI304EM1

    APP='%JOBNAME(1:2)'

    JOB VI304EM1

    ECHO PRDRD01

    PRDRD01

    IF ESPUSR NE "" THEN ESPUSR='%ESPUSR'

    IF DATASET NE "" THEN DATASET %DATASET

    DATASET D675.CMN.SHRD.JCL.PROD

    IF CCCHK1 NE "" THEN CCCHK %CCCHK1

    CCCHK PROC(REPTPROC) RC(0:12) OK CONTINUE

    IF CCCHK2 NE "" THEN CCCHK %CCCHK2

    CCCHK PROC(BACKUP) RC(0:12) OK CONTINUE

    RESOURCE ADD(0001,VI_INFOPAC)

    IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE

    RESOURCE ADD(0001,INITIATOR_A)

    IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE

    RESOURCE ADD(0001,MOBIUS_JOB_RESOURCE)

    RUN TODAY

    ENDJOB

    @@ENDTPL



  • 16.  Re: Templates

    Posted Jun 27, 2018 10:22 AM

    Hi Lucy,

     

    Looks like it does resolve to the value I want which is PRDRD01.

     

    $MOBIUS VI304EM1

    APP='%JOBNAME(1:2)'

    JOB VI304EM1

    ECHO PRDRD01

    PRDRD01

    IF ESPUSR NE "" THEN ESPUSR='%ESPUSR'

    IF DATASET NE "" THEN DATASET %DATASET

    DATASET D675.CMN.SHRD.JCL.PROD

    IF CCCHK1 NE "" THEN CCCHK %CCCHK1

    CCCHK PROC(REPTPROC) RC(0:12) OK CONTINUE

    IF CCCHK2 NE "" THEN CCCHK %CCCHK2

    CCCHK PROC(BACKUP) RC(0:12) OK CONTINUE

    RESOURCE ADD(0001,VI_INFOPAC)

    IF RESOURCE1 NE "" THEN RESOURCE %RESOURCE

    RESOURCE ADD(0001,INITIATOR_A)

    IF RESOURCE2 NE "" THEN RESOURCE %RESOURCE

    RESOURCE ADD(0001,MOBIUS_JOB_RESOURCE)

    RUN TODAY

    ENDJOB

    @@ENDTPL

     

    Thanks,

    Sharon



  • 17.  Re: Templates

    Broadcom Employee
    Posted Jun 27, 2018 10:25 AM

    Hi Sharon,

     

    Great.

     

    Then you are good.

     

    Lucy



  • 18.  Re: Templates

    Posted Jun 27, 2018 10:27 AM

    Thank you.



  • 19.  Re: Templates

    Posted Jun 27, 2018 11:13 AM

    Hi Sharon, 

    I don't think this is going to work as expected.

     

    Forget templates for the moment.  I have two job definitions in the appl 

    JOB A

      RUN ANY

      ESPU = 'ABC'

    ENDJOB

     

    JOB B

      RUN ANY

      ESPU = 'XYZ' 

    ENDJOB 

     

    Someone might expect that JOB A would pass ABC into the JCL.  It does not. It reads through the entire appl and sets the value ESPU  to XYZ. Then XYZ is passed into JOB A.  In an appl there is only one variable ESPU there will not be a separate one for each job. 



  • 20.  Re: Templates

    Posted Jun 27, 2018 11:34 AM

    This is interesting, I’ll have to do more testing around all of this.