ESP Workload Automation

 View Only
  • 1.  APPLINs, REEXEC and RELDELAY

    Posted Nov 08, 2019 03:31 PM
    Hi all,
    I'm looking for syntax suggestions on how to code something like an APPLINs to REEXEC a common job so that two jobs (or more) aren't running at the same time if a job runs longer than the REEXEC value. In this example if the job runs 12 minutes, there would be 3 jobs 'active' at the same time.  After the 12 minute job completes, I'm looking for the second job to wait 5 mins before being inserted.
    Any ideas? Can I replace the REALNOW parm with a different action?  

    JOB INSERT.JOBS TASK
    RUN ANY
    NORUN SUNDAY
    TIME='%ESPAHH%ESPAMN'
    ESP APPLINS APPL(%ESPAPPL..%ESPAPGEN) STATEMENTS(' +
    SAP_JOB ABC%TIME..1290; +
    RUN NOW; AGENT %AGNTNAME; STARTMODE ASAP; +
    SAPJOBNAME  ABC; +
    ABAPNAME xxxxxxxxxxxxxxx; +
    VARIANT vvvvvvvvvvvvv; +
    ENDJOB')
    REEXEC AT('REALNOW PLUS 5 MINUTES')
    ENDJOB

    I can schedule a string of repeated jobs with a RELDELAY, that works, but is tedious.
    Thanks for your thoughts, Loraine


  • 2.  RE: APPLINs, REEXEC and RELDELAY

    Posted Nov 08, 2019 05:03 PM
    ​Loraine,
    Might I suggest that instead of using APPLINS or REEXEC, consider using a renewable resource with a max and available value of 3.  this would allow you to control the jobs a little easier.  You could then handle the 10 minute delay with a RELDELAY.

    Just a thought. .

    <JC>


  • 3.  RE: APPLINs, REEXEC and RELDELAY

    Broadcom Employee
    Posted Nov 08, 2019 05:04 PM
    Hi Loraine,

    There are two possible changes:
    - ESPA variables are related to the trigger of the event, and they will NOT change over time. So you will need to use GENTIME for "current" time;
    - Add REXX and JOBONCSF to make sure the previous run has completed BEFORE issue APPLINS command.

    JOB INSERT.JOBS TASK
    RUN ANY
    NORUN SUNDAY
    IF ESPREEXEC# =0 THEN DO
    TIME='%ESPAHH%ESPAMN'
    LAST='ABC%TIME..1290'
    ENDDO
    <use REXX and JOBONCSF to check if last job(variable LAST) has completed>
    <if not, then REEXEC IN(1) and EXIT>
    GENTIME CUR REALNOW
    TIME='%CURHH%CURMN'
    LAST='ABC%TIME..1290' /*save last job name*/
    ESP APPLINS APPL(%ESPAPPL..%ESPAPGEN) STATEMENTS(' +
    SAP_JOB ABC%TIME..1290; +
    RUN NOW; AGENT %AGNTNAME; STARTMODE ASAP; +
    SAPJOBNAME ABC; +
    ABAPNAME xxxxxxxxxxxxxxx; +
    VARIANT vvvvvvvvvvvvv; +
    ENDJOB')
    REEXEC IN(5)
    ENDJOB

    Note: you may refer to example below on REXX and JOBONCSF:
    https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-mainframe-software/automation/ca-workload-automation-esp-edition/11-4/examples-cookbook/bypass-a-job-based-on-status-of-another-job.html

    There are other possible ways too, like:
    - Use RESUB instead;
    - Issue command to Trigger the event at the proper time.

    Lucy