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 DOTIME='%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 REALNOWTIME='%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.htmlThere are other possible ways too, like:
- Use RESUB instead;
- Issue command to Trigger the event at the proper time.
Lucy
Original Message:
Sent: 11-08-2019 03:31 PM
From: Mueller
Subject: APPLINs, REEXEC and RELDELAY
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