Terminating repeating

If the next calculated Input Arrival time is later than the UNTIL time, or if the number of occurrences has reached the COUNT value, the ADD command does not submit any further occurrences.

The ADD command also stops if it detects another occurrence, submitted in other ways, with an Input Arrival time between the ORIGIN time and up to and including the calculated next Input Arrival. This prevents instances where multiple triggers may have added overlapping cycles to leap over each other, compromising the desired cycle interval.

Use of the NOTIFY keyword can be used to allow extra processing to be added into the repeating occurrence that only runs when the final occurrence of the cycle as run.

For example, ADD FROM(0900) UNTIL(2100) EVERY(0015) NOTIFY(W) means that the 2100 instance of the ADD job terminates with RC=4. Conditional dependencies can then be used to run jobs only when the ADD job terminates with RC=4, allowing final processes to be run at the end of the repeating cycle.

Conditional dependencies can also be used to terminate the repeating cycle early. If whatever process is being run by the repeating occurrence can detect it no longer needs to repeat, for example all the data for the day has arrived, then it too could issue a return code, that conditional dependencies could use to stop a further run of the ADD job.