ESP Workload Automation

  • 1.  Template & Offset In Minutes Rather Than Hours?

    Posted Mar 04, 2019 12:39 PM

    We currently have a job that is defined with an hourly offset to run a few times a day.  The template if defined within an appl.

    TEMPLATE HOURLY (1,OFFSET)                      
    /*** THESE JOBS WILL RUN EVERY 2 HOURS FROM 0600
    JOB IMGDLY01.%offset                            
      DELAYSUB 0800AM PLUS %OFFSET HOURS             
         RUN WORKDAYS                                  
     ENDJOB     

    ENDTEMPL      
    HOURLY 00     
    HOURLY 02     
    HOURLY 04     
    HOURLY 06     
    HOURLY 08     

     

    The Programmer now wants this job to run every 30 minutes instead of 2 hours.  I tried using minutes in place of HOURS and HOURLY but that did not work.

    Does anyone know if a template can be set within an appl to run in smaller increments than an hour?

    If so,  can you point me to where I can find how to code this?

    Otherwise, I'm thinking I will need to pull this job from the appl and put it in an appl of its own with the event running every 30 minutes and using a Suspend and Resume time.

     

    Thanks in advance for your help - it is appreciated!



  • 2.  Re: Template & Offset In Minutes Rather Than Hours?
    Best Answer

    Posted Mar 04, 2019 01:04 PM

    You could use some REXX code to do the math and set a variable like this:

     

    TEMPLATE EO990W01_WRKDAYS (1,OFFSET_WRKDAYS)  
     NT_JOB EO990W01.%OFFSET_WRKDAYS               
       . . .
       DELAYSUB 00:15 PLUS %OFFSET_WRKDAYS MINUTES
       RUN WORKDAYS                               
     ENDJOB                                       
    ENDTEMPL                                      
                                                  
    REXXON                                        
     DO I=0 TO 1410 BY 30                         
      "EO990W01_WRKDAYS "I                        
     END                                          
    REXXOFF                                       

     

    This one runs the job every 30 minutes.  You could figure the math differently if you need it to run every minute.  You could also considuer using the REEXEC statement in a task, like this:

     

    JOB EO900W01.INSERT TASK                                    
     RUN WORKDAYS                                               
     RUN SAT                                                     
     TIME='%ESPAHH%ESPAMN%ESPASS'                               
       ESP APPLINS APPL(%ESPAPPL..%ESPAPGEN) STATEMENTS -       
       ('NT_JOB EO900W01.%TIME; -                               
          AGENT WEPSDP01; -                                     
          CMDNAME \\wepsdp01\epsd\ecms\EO900W01.bat; -          
          EXITCODE 222 SUCCESS; -                               
          EXITCODE 1 SUCCESS; -                                 
         ENDJOB')                                               
       REEXEC AT('REALNOW PLUS 60 SECONDS')                     
      ENDDO         

     

    Hope this helps!                                            



  • 3.  Re: Template & Offset In Minutes Rather Than Hours?

    Posted Mar 04, 2019 01:14 PM

    I am sure Jonathan's solution will also work.  To keep with the TEMPLATE strategy, try the one below. 

     

    TEMPLATE MINUTES (1,OFFSET)
    /*** THESE JOBS WILL RUN EVERY 30 MINUTES FROM 0800
    JOB IMGDLY01.%OFFSET
    DELAYSUB 0800AM PLUS %OFFSET MINUTES
    RUN WORKDAYS
    ENDJOB
    ENDTEMPL
    MINUTES 0
    MINUTES 30
    MINUTES 60
    MINUTES 90
    MINUTES 120
    MINUTES 150

     

    Don



  • 4.  Re: Template & Offset In Minutes Rather Than Hours?

    Posted Mar 04, 2019 01:14 PM

    Many thanks for your help - it is appreciated!!!!



  • 5.  Re: Template & Offset In Minutes Rather Than Hours?

    Broadcom Employee
    Posted Mar 06, 2019 01:14 PM

    Hi Barb,

     

    As you may not know, ESP community has been moved to:

    CA Mainframe Workload Automation 

     

    And this post will be move to the new place.

     

    Thank you,

     

    Lucy