View previous topic :: View next topic
|
Author |
Message |
jeyaraj
New User
Joined: 14 Nov 2005 Posts: 5
|
|
|
|
hi,
i want to run the jobs serially one after another. for example
will be submitting JOB1, JOB2 and JOB3 one after another continuously but JOB2 should start only after JOB1 completes(job1 will run for long time) and JOB3 should start only after JOB2 completes.
NOTE: there is no scheduler to schedule the jobs. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
1. Have JOB1 submit JOB2, then JOB2 submit JOB3, and so on.
2. Use a control resource. Have JOB1 allocate a dataset with DISP=OLD or DISP=MOD. Have JOB2 allocate the same dataset, also with DISP=OLD. With the dataset contention, JOB2 will swap out until JOB1 completed, thus freeing the dataset. The same could apply to JOB2 and JOB3.
3. Have a program in JOB1 create some sort of checkpoint dataset entry when it completes. Have a program in JOB2 loop in a wait state, reading that dataset, until the entry for JOB1 has been done. Do the same for JOB2 and JOB3. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Why not to code them in a single job instead if you dont have any schedular for those jobs ? |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi jeyaraj,
You can even add an step at the end of the 1st and 2nd job.
The Step uses the internal reader. The first triggers the 2nd and the 2nd triggers the 3rd...using the internal reader.
~Vamsi |
|
Back to top |
|
|
praveenkumar_win
New User
Joined: 18 May 2006 Posts: 6 Location: Chennai
|
|
|
|
Submit JOBA
Submit JOBB with AFTER statement.
Syntax:
/*AFTER jobname(preeceding jobname)
Example :
//JOBA JOB (XXXXXX,XXX,XXXXXXX,XXX,XXX,XXX),'MAINFRAME TIP DAY ',
// NOTIFY=XXXXXXX
//JOBB JOB (XXXXXX,XXX,XXXXXXX,XXX,XXX,XXX),'MAINFRAME TIP DAY ',
// NOTIFY=XXXXXXX
/* AFTER JOBA
The AFTER statement puts the job in the Input Queue until its preceeding job is finished.
Correct me if I am wrong.
Thanks,
Praveen. |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi praveenkumar_win,
The AFTER........statement should be specify to your shop only.
It maynot work for all..
~Vamsi |
|
Back to top |
|
|
honeypria567
New User
Joined: 20 Nov 2006 Posts: 14 Location: chennai
|
|
|
|
hi,
as of my knowledge it is possible by triggering the jobs.
simply mention JOB2 in JOB1 as well as JOB3 in JOB2.
another way is using COND.
Correct me if I am wrong.
regards,
honey. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Don't know what OS you use but may be this can help. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If these are production jobs and your site has a scheduling package, talk with your Scheduling people and define Job2 to run depending on the successful completion of Job1. Then define Job3 to run depending on the successful completion of Job2.
If this is a test, submit them in order (j1, j2, j3) using the same JOBNAME. They will run one behind the other - 2 of the same name will not run concurrently.
If these are very short jobs, you might force your own "enqueue" by using a dataset with OLD (mentioned in a prior reply) so that only 1 can have it at a time.
If these are NOT short jobs, the operations department may have a problem with these jobs being in 3 initiators and 2 of them not doing anything. Also, using this method will generate system messages that a resource is "UNABLE TO ALLOCATE", which are frowned on by Operations. |
|
Back to top |
|
|
|