5 pts.
 JCL wait command
I want to submit a job. Imbeded in the JCL I want the WAIT command.  I want to wait till a second job is completed.  I do not know the format of the JCL statment.  I am using /* AFTER next_job_name,WAIT

What am I missing? 



Software/Hardware used:
IBM mainframe
ASKED: March 22, 2011  6:06 PM
UPDATED: May 5, 2011  2:20 PM

Answer Wiki:
There are a few solutions to this issue. The <b>best</b> solution is to change the submission schedule of the two jobs. Submit the 2nd job first, and when it is finished (successfully), then submit the 1st job. You can use the TYPRUN=HOLD jobcard parameter when submitting the 1st job, and when the 2nd job is completed, you can then 'release' the job that is on HOLD. I believe you need to know the assigned JES number to release the held job. This can be done manually by the computer operator or if the 2nd job can obtain the JES number, execute a step (in the 2nd job) to release the held job, which does essentially what the operator would do. The best long term solution (an the most straight forward) is to rearrange the job schedule.
Last Wiki Answer Submitted:  March 24, 2011  4:49 pm  by  Sunsetrider   860 pts.
All Answer Wiki Contributors:  Sunsetrider   860 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Basing the execution of one job on the completion of another job is best left to scheduling software. Because, maybe, you only want the second job to run if the first job completes with a RC of less than 5 (or some other condition).

Without a job scheduler, you will need manual intervention from operators. Not a good thing. (In the old days, that is how we ran a series of job streams. Operator would get out the Run Book and submit a job. Then based on the return codes would refer to the Run Book to see what job to run next. Not good.)

You might also consider having the first job submit the second job. Using IF/THEN/ELSE in the first job you can decide to submit the second one or not.

 5,205 pts.