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

How to make job to wait until other gets completed?


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

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Apr 11, 2012 6:28 pm
Reply with quote

Hi.

I have created a job using REXX, and used TSO Submit in Rexx so that it gets submitted.

I have one more job to submit in the same rexx code.
Initially i have used same name for both jobs. So i thought, duplicate/ second job waits until the first one completes.

But this is not happening every time.. (Some how its happening in few cases and second one waits until the first one)

How can i achieve this requirement now.?
My both jobs are being submitted from REXX.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 11, 2012 6:33 pm
Reply with quote

if the first job, as its last step, submitted the second job,
instead of your REXX Scrpt submitting the second job,
then you would have no problem.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Apr 11, 2012 6:37 pm
Reply with quote

Make sure all jobs are routed to the same system in your sysplex.

Check if your system has a 'single thread' initiator. That is, both jobs should be submitted with the same jobclass and there should be only one initiator that accepts that jobclass.
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Apr 11, 2012 7:35 pm
Reply with quote

Hi Both. Thanks alot for your suggestions.

I have added the second job in the last step of first one using below.

//STEP1 EXEC PGM=IEBGENER,COND=(4,LT)
//SYSUT1 DD DSN=DSR.SRINI.SKELS(JOB2),DISP=SHR
//SYSUT2 DD SYSOUT=(,INTRDR)
//SYSIN DD DUMMY
//*

Its working fine now.. thank you.

@ Pedro. Hi pedro. I made the class for the two jobs same first.. Then i tried.. It still submitted second one. So i have added EXEC step.

I guess its related to some installation options, or i might not be able to understand to that level to make. But thanks very much for you both genius for spending few minutes on my question and helping to complete my requirement...

Srinivasarao Daruna
--------------------------

Learn with Passion. Share without expectation.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Apr 11, 2012 10:15 pm
Reply with quote

Quote:

@ Pedro. Hi pedro. I made the class for the two jobs same first.. Then i tried.. It still submitted second one.

My suggestion was not about delaying the submission of the job (which is your explicit question).

My suggestion was to prevent concurrent execution of two jobs (which was your implied question).
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 Apr 11, 2012 10:46 pm
Reply with quote

Hello,

For the single job class / initiator to do what you want, there can be only 1 initiator with that job class assigned.

You would need to talk with your system administrators or possibly the scheduling people to find if there is a class that is only assigned to 1 initiator and that it will always be assigned to only 1 initiator. As you have seen, if you use a job class that is active in more than 1 initiator, the second job runs immediately.

Another way to accomplish what you want and have the solution external to your jcl is to have the second job defined as a successor to the first job (in the scheduling system).
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 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
No new posts VSAM RLS Wait time JCL & VSAM 3
Search our Forums:

Back to Top