Usage notes for REPEAT mode
REPEAT mode is applied every time you set either UNTIL
or EVERY
.
ADD [JCLVTAB(<table>)] [DEPRES(Y|N)]
[FROM(hhmm)] [UNTIL(hhmm)] [EVERY(hhmm)] [COUNT(nnnn)]
[ORIGIN(START|END|IA)] [RESOLVE(NEXT|GAP|BOTH|hhmm)]
[RESTART(opnum[,FLUSH])
[EARLY(ABORT|CONTINUE)] [NOTIFY(N|W|E)]
[DLDAY(n)] [DLTIME(hhmm)]
Use the REPEAT mode to dynamically schedule a repeating occurrence between set times, or for a certain number of occurrences. The maximum period of repeating is 24 hours, after which a new cycle must be initiated.
When you use the ADD
command in REPEAT mode, without
setting the RESTART keyword, it resubmits only the same occurrence or group. If it is included
in an occurrence that is part of a group, the entire group is resubmitted, otherwise only the
single controlling application is resubmitted. For this reason, the
ADID
or GROUPDEF
keyword is not needed.
However, if you specify any of them and it does not match the current occurrence or group, the
ADD
command fails.
The initial occurrence in the cycle can be added to the current plan by any of the following ways:
- Normal planning using a run cycle to add a single occurrence with
an Input Arrival time matching the
FROM
time - Adding manually by using 5.1
- Submitting by an
ADD
command running in ONCE mode - Submitting by a PIF
INSERT
command - An Event Triggered Tracking rule
The occurrence is then repeated by including a Workload Automation Programming Language step either within an existing job in the occurrence or group, or as a standalone job, scheduled at the point where you want the next occurrence to be added to the plan.
- The WAPL job is the last job of the application, if the
RESTART
keyword is not set. - The first operation of the application is set as time-dependent. If you have more than one first operation, create a time-dependent dummy operation as the internal predecessor of all your first operations.
- It is recommended that you set the
RESTART
keyword to reference the first operation. - When you manually add the application to the plan, ensure that the application IA time
is not earlier than the system current time. As the result, the application occurrence is
kept is Waiting status until the IA time is reached. When the last operation, which is the
WAPL job, has completed, the following application occurrence is added, and so on.
To interrupt this process, delete or complete the occurrence that is in Waiting status; in this way, the WAPL job does not run and no other occurrences are added to the plan.
Modifying the ORIGIN
and RESOLVE
keywords
will influence when the next occurrence is scheduled to start.
The default behaviour is ORIGIN(END)
and RESOLVE(NEXT)
.
This means that the time when the ADD
command
runs is used to calculate the next run, which is the next multiple
of EVERY
following the time ADD
runs.
For example, ADD FROM(0900) UNTIL(2100) EVERY(0015)
repeats
from 9am to 9pm every 15 minutes. If the occurrence starts at 1000
and ends at 1012, the next occurrence will be at 1015. If the occurrence
starts at 1000 and runs until 1020, the next occurrence will be at
1030.
This mechanism effectively means that if a single occurrence runs
longer than the EVERY
interval, the intervals
are skipped to catch up with the next time in the repeating cycle.
Using RESOLVE(GAP)
ensures that the EVERY
interval
is used to make sure that each occurrence starts with the same interval
between one finishing and the next starting. For example, ADD
FROM(0900) UNTIL(2100) EVERY(0015) RESOLVE(GAP)
repeats
from 9am to 9pm every 15 minutes. If the occurrence starts at 1000
and ends at 1012, the next occurrence is at 1027. If the occurrence
starts at 1000 and runs until 1020, the next occurrence is at 1035.
Using RESOLVE(BOTH)
ensures that the EVERY
interval
is used to make sure that each occurrence starts with at least the
specified EVERY
interval between one finishing
and the next starting, but also runs on perfect multiples of the EVERY
time.
For example, ADD FROM(0900) UNTIL(2100) EVERY(0015) RESOLVE(BOTH)
repeats
from 9am to 9pm every 15 minutes. If the occurrence starts at 1000
and ends at 1012, the next occurrence is at 1030. If the occurrence
starts at 1000 and runs until 1020, the next occurrence is at 1045.
Using RESOLVE(hhmm)
ensures that hhmm
is
used to make sure that there is a minimum time between one occurrence
ending and the next one starting, but the occurrence starts on a perfect
interval of the EVERY
time. For example, ADD
FROM(0900) UNTIL(2100) EVERY(0015) RESOLVE(0005)
repeats
from 9am to 9pm every 15 minutes. If the occurrence starts at 1000
and ends at 1012, the next occurrence is at 1030. If the occurrence
starts at 1000 and runs until 1020, the next occurrence is at 1030.
Modifying the ORIGIN
point can modify the
characteristics of how the occurrences are calculated. Using ORIGIN(IA)
with RESOLVE(NEXT)
reproduces
the behaviour that Repeat Every/Until achieves when using static run
cycles. Every possible interval is scheduled. For example, ADD
FROM(0900) UNTIL(2100) EVERY(0015) ORIGIN(IA) RESOLVE(NEXT)
repeats
from 9am to 9pm every 15 minutes. If the occurrence starts at 1000
and ends at 1012, the next occurrence is at 1015. If the occurrence
starts at 1000 and runs until 1020, the next occurrence is at 1015.
COUNT
can be used to limit the number of
repeats, with or without FROM | UNTIL
limits.
For example, in the command ADD EVERY(0015) COUNT(10)
the
first instance could have been added by ETT, in which case the second
instance is added a perfect multiple of 15 minutes from the initial
triggering event. This will happen repeatedly until 10 individual
runs have occurred.
For consistency between Batch Loader and the REPEAT mode of the ADD
command,
to add repeating run cycles ADD FROM(0900) UNTIL(2100)
EVERY(0015)
is identical to ADD IATIME(0900)
RPTEND(2100) RPTEVRY(0015)
.