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 job to wait until other gets completed?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to make job to wait until other gets completed?
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    Post subject:
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

Senior Member


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

PostPosted: Wed Apr 11, 2012 6:37 pm    Post subject: Reply to: How to make job to wait until other gets completed
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    Post subject: Reply to: How to make job to wait until other gets completed
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

Senior Member


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

PostPosted: Wed Apr 11, 2012 10:15 pm    Post subject: Reply to: How to make job to wait until other gets completed
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

Site Director


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

PostPosted: Wed Apr 11, 2012 10:46 pm    Post subject:
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    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