set job priority

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
GeorgeQ
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Skillset: SAS jcl
Referer: Kevin

set job priority

Postby GeorgeQ » Sat Jun 24, 2017 3:01 am

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!

User avatar
prino
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
Referer: Google
Location: Vilnius, Lithuania
Contact:

Re: set job priority

Postby prino » Sat Jun 24, 2017 3:17 am

Submit JOB1 before JOB2!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy

GeorgeQ
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Skillset: SAS jcl
Referer: Kevin

Re: set job priority

Postby GeorgeQ » Sat Jun 24, 2017 3:20 am

Thank you!

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

Thanks!

User avatar
vasanthz
Posts: 27
Joined: Thu Aug 05, 2010 2:53 pm
Skillset: SAS
Referer: google

Re: set job priority

Postby vasanthz » Sat Jun 24, 2017 3:58 am

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.

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

Re: set job priority

Postby Robert Sample » Sat Jun 24, 2017 4:14 am

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.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: set job priority

Postby NicC » Sat Jun 24, 2017 4:50 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic