Page 1 of 1

set job priority

PostPosted: Sat Jun 24, 2017 3:01 am
by GeorgeQ
Hello.

I have two jcl jobs, JOB1 and JOB2

I want Job1 run firstly then Job2, currently their job class are same(CLASS=L). what change should I make to make job 1 run before job2?


Thanks!

Re: set job priority

PostPosted: Sat Jun 24, 2017 3:17 am
by prino
Submit JOB1 before JOB2!

Re: set job priority

PostPosted: Sat Jun 24, 2017 3:20 am
by GeorgeQ
Thank you!

How about ifI change job class of job1 from L to K? then job1 will be executed firstly?

Thanks!

Re: set job priority

PostPosted: Sat Jun 24, 2017 3:58 am
by vasanthz
Job class has no relation to the order in which jobs run. You need to submit job2 after job1 or have it setup in scheduler as a dependency.

A sloppy way is to submit both the job1 and job2 with the same job name and make one wait till another completes.

Re: set job priority

PostPosted: Sat Jun 24, 2017 4:14 am
by Robert Sample
There are only two ways to accomplish this;

1. Use a job scheduler and put a dependency on JOB2 to run after JOB1
2. Make sure that class L is assigned to only one initiator and submit JOB1. Once JOB1 starts executing, submit JOB2. If you submit JOB1 and JOB2 without verifying JOB1 has started executing, it is entirely possible for JOB2 to start executing before JOB1.

JES explicitly states that merely submitting JOB1 before JOB2 does not ensure that JOB1 will execute before JOB2 even if they are in the same job class. And if the two jobs are in different job classes, they may well be assigned to different initiators so JOB2 could run before JOB1, while JOB1 is running, or after JOB1.

And terminology is critical in IT, where similar terms may have very different meanings. None of this has anything to do with the job PRTY= option which may (or may not -- JES2 may ignore the option depending upon how the site is set up) be used on the JOB statement to control job processing priority. Using a post title of "set job priority" is very misleading about what you want to do.

Re: set job priority

PostPosted: Sat Jun 24, 2017 4:50 pm
by NicC
Another way is to have job 1 submit job2 as the last thing it does before finishing. Examples of all the options are around on the forum.