Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to make one job to wait till another one completes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to make one job to wait till another one completes
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

Moderator Team Head


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

PostPosted: Mon Aug 07, 2006 8:54 pm    Post subject: Re: How to make one job to wait till another one completes
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: 1452
Location: Chicago, IL

PostPosted: Tue Aug 08, 2006 6:26 am    Post subject: Re: How to make one job to wait till another one completes
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    Post subject:
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    Post subject: Hi
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    Post subject:
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    Post subject: Re: How to make one job to wait till another one completes
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 09, 2007 4:08 pm    Post subject:
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

Site Director


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

PostPosted: Wed Jan 10, 2007 5:04 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply yugendran COBOL Programming 5 Wed Oct 05, 2016 1:46 pm
No new posts OMEGAMON to see In-DB2 times and Wait... Archana89 IBM Tools 4 Fri Mar 04, 2016 11:28 am
No new posts DFSORT VB File make 2 lines from 1 BridgetBrackenbury DFSORT/ICETOOL 2 Fri Feb 12, 2016 3:48 am
No new posts How to make REXX process different GDGs? venksiv CLIST & REXX 15 Thu Sep 24, 2015 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us