MainframeSupports
tip week 37/2008:

Not many years ago I became aware of the JCL parameter RESTART. RESTART is used in the JOB card to tell JES the name of the first step to execute in the submitted job. If RESTART is not used the first executed step is of course the first step in the job. And now you may think: "Yes, correct and so what...". So I did the first time I read about the RESTART parameter. I could not think of anything useful about this feature.

When I create a job containing many steps (which I often do), I typically test one step at a time. Before each step I add a //* comment without any contents. By removing the asteriks (*) I have an "end of job" card. All the remaining steps after the "end of job" card will not be processed by JES. This is very useful, I think. Now assume that I have tested step one and it took 20 minutes to execute and now I am ready to test step two. Then it is both boring and time and CPU consuming to run step one again for twenty minutes in order to test step two. Instead you may add RESTART=step two (using the proper name of course) and re-submit the job. You must remember to re-establish your //* comment in front of step two. Now the job starts executing step two. This is much easier than removing or commenting out step one.

If you think that the above approach is something you may benefit from please be aware that using temporary datasets (DSN=&TEMPDATA) is not a good idea. They have a built in tendency to disappear when the job terminates. Let me give you an example of how I build my jobs:

//AGOODJOB JOB ,'COMMENT',CLASS=A, ...
//* RESTART=STEP0002,
// NOTIFY=MYUSER ...
//*
//STEP0001 EXEC ...
...
//*
//STEP0002 EXEC ...
...
//*
//STEP0003 EXEC ...
...

In this example ... symbolises all the parameters or DD cards I normally add to make the job work. The way I have build the JOB card makes it possible for me to avoid adding the restart parameter when I want to use the RESTART parameter. I simply remove the asteriks (*) in front of the parameter instead. Now I just have to mention that I am not a fan of using JCL procedures. Therefore I have no experience in using the RESTART parameter in conjunction with steps in JCL procedures or not even in restarting steps calling a JCL procedure. If you have such needs you have to try it yourself, ask a friend or read the manual.

Previous tip in english        Sidste danske tip        Tip list