Prevent running a step twice

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Re: Prevent running a step twice

Postby NicC » Tue Mar 29, 2016 5:57 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Prevent running a step twice

Postby Robert Sample » Tue Mar 29, 2016 6:30 pm

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.
Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Prevent running a step twice

Postby Blackthorn » Thu Mar 31, 2016 6:52 pm

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.
Posts: 130
Joined: Tue Feb 01, 2011 7:12 pm
Has thanked: 1 time
Been thanked: 9 times


Return to JCL


  • Related topics
    Last post