Page 2 of 2

Re: Prevent running a step twice

PostPosted: Tue Mar 29, 2016 5:57 pm
by NicC
One assumes that you already have condition code checking within your job so how do you think it would happen differently to how it is done now? The way to bypass steps are many - the simplest is to use the RESTART parameter on the jobcard (which did not happen in your case). If you could put in a conditon code that would bypass step 1 on refeed then next cycle, when the job is refed to start the cycle, the first step will again be bypassed and would continue to do so for ever-and-a-day. You need to design your batch processes so that they can be refed without having to manually interfere with the restart step.

Re: Prevent running a step twice

PostPosted: Tue Mar 29, 2016 6:30 pm
by Robert Sample
Job schedulers are based on jobs -- not steps -- and hence can let the same step run multiple times in restart situations. Your application SHOULD be designed to prevent this (there are various ways to do it, such as clearing data sets after use or checking a record in a data set to determine if the run can proceed).

However, the bottom line is that no system can completely prevent human error (such as restarting the wrong step), so you have to design the application to be recoverable from mistakes.

Re: Prevent running a step twice

PostPosted: Thu Mar 31, 2016 6:52 pm
by Blackthorn
As Robert has said, you cannot entirely prevent human error. But if you use the TWS options to restart the job for you, rather than editing the JCL and manually coding a RESTART statement, this might reduce the likelihood. TWS will always suggest what it thinks is the best step to restart from, and prompt you accordingly. In most cases this will be the step that the job failed on, unless that's not possible for some reason - for example a temporary work dataset is created in an earlier step that would not be available if the job was restarted.