IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to make one job to wait till another one completes


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jeyaraj

New User


Joined: 14 Nov 2005
Posts: 5

PostPosted: Mon Aug 07, 2006 8:47 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 07, 2006 8:54 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Aug 08, 2006 6:26 am
Reply with quote

Why not to code them in a single job instead if you dont have any schedular for those jobs ?
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Aug 08, 2006 9:46 am
Reply with quote

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
View user's profile Send private message
praveenkumar_win

New User


Joined: 18 May 2006
Posts: 6
Location: Chennai

PostPosted: Tue Aug 08, 2006 3:45 pm
Reply with quote

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
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Aug 09, 2006 12:23 pm
Reply with quote

hi praveenkumar_win,

The AFTER........statement should be specify to your shop only.

It maynot work for all..

~Vamsi
Back to top
View user's profile Send private message
honeypria567

New User


Joined: 20 Nov 2006
Posts: 14
Location: chennai

PostPosted: Tue Jan 09, 2007 2:14 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 09, 2007 4:08 pm
Reply with quote

Don't know what OS you use but may be this can help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 10, 2007 5:04 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Job completes in JES, but the status ... IBM Tools 1
No new posts trying to make sense of keylists TSO/ISPF 11
No new posts Wait for job rc CLIST & REXX 10
No new posts Make cobol variable value a variable COBOL Programming 3
No new posts Started transaction enters "firs... CICS 3
Search our Forums:

Back to Top