Priority will give you the behavior you expect but not necessarily the result. If there are several jobs with a common Control Resource that are all ready to be submitted, the one with the highest priority will be submitted and if that job has an exclusive Control Resource, the other jobs will not be submitted.
However, let's assume the jobs that specify a Control Resource are submitted intermittently throughout the day. When the Backup (the one with the "exclusive" attribute) arrives, there is already a job using that same reosurce in Shared mode already running. The Backup must wait. While one "shared" job is running, a second "shared" job becomes ready. It will then begin running even though it has a lower priority. This is because another job is already running using the shared resource so the Backup cannot run. You can see this can go on for quite a while, perhaps indefinitely, and the backup is never run.
An alternative, is to use a Quantitative Resource with the CRITICAL attribute. Let's say you wish to allow up to 100 "shared" jobs to run simultaneously. Define a quantitative resource called "backup" with a quantity of 100. Define each shared job as using 1 unit of "backup". Define the Backup job as using all 100 units, also that the job is CRITICAL and give it a high priority.
Control-M now accumulates the "backup" resources for the Backup job so that even if the job cannot start because other jobs are using that resource when the Backup is submitted, no new "shared" jobs will be allowed tostart.
Sorry , that iam pulling back this post to answer my question using resources with Priority.
I have 6 AFT jobs , that i dont want to execute parallely and also i want to have 10 mins sleep interval after execution one AFT job. what i did is that,
i created one sleep job for creating the 10 mins interval after succesfull completion of every job it will execute, so that it should work like this, after one AFT job it should execute sleep job to have sleep of 10 mins interval , then process the AFT job then sleep of 10 mins , and so on.
I created Control Resources with exclusive for every 6 AFT job and Sleep job, point is that Sleep job should execute right after the AFT job. So i made Sleep job as critical and with High Priortiy as 99 with CR exclusive and rest of AFT job as Non Ciritcal , default Priority is AA with CR exclusive.
What i observed is that, after every AFT job , Sleep job is not executing, I think Logically it should execute. i am thinking, as soon as AFT job releases Control resourcs Other AFT job picks that CR and started executing, ( as CR is released first and then Condition is created after that ) where as Sleep need to meet the inconditions and then CR with exclusive. I guess time delay passing the conditions from AFT to Sleep job casuing the sleep job not to run , So flow is not working as it supposed to be.
Also i tried with Shared QR and and exlusive QR,making Shared QR for Sleep and AFT job is exclusive.
1. Sleep job with QR 1
2. Every AFTjob with QR 2,
and total number of QR defined is 2.
Other way around is am thinking executing PRECMD as sleep job on AFT job if the SLeep job is not executing the correct time.
POSTCMD on AFT jobs is not working.
SO experts please suggest/share if any one has implemented this flow.