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
 

 

Subsequent Job runs one after the other

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Wed Oct 24, 2007 11:27 am    Post subject: Subsequent Job runs one after the other
Reply with quote

Hi,

I am required to run two jobs one after the other. However the second job is to be trigerred only if the first job has ended successfully.

Can any one please let me know how can I develop my main JCL so that I can run both the jobs (JOB A as well as JOB B):

Code:

//PV5240A  JOB (8200,2395),'SWAPNADEEP PV5240A',                 
//      MSGCLASS=J,NOTIFY=PV5240A,CLASS=J,MSGLEVEL=1,SCHENV=TDH1 
/*ROUTE PRINT N11R10                                             
//PROCLIB  JCLLIB ORDER=(PV5240A.G3709.PROD.SRUNJCL)             
//K3709    EXEC PROC=K3709W01   

JOB A
                               



Code:

//PV5240AB JOB (8200,7464),'SWAPNADEEP PV5240A',SCHENV=TDPT,             
// MSGLEVEL=1,MSGCLASS=C,CLASS=A,NOTIFY=PV5240A,PRTY=4           
//PROCLIB JCLLIB ORDER=N48FF9.G3709.RUNJCL                     
/*ROUTE PRINT HTF1                                             
//PV5240C EXEC PROC=K3709W02                                   
//*                                                             

JOB B
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Oct 24, 2007 11:38 am    Post subject: Reply to: Subsequent Job runs
Reply with quote

Ganguly,

Quote:
Can any one please let me know how can I develop my main JCL so that I can run both the jobs
(JOB A as well as JOB B):


Do you want to have both these jobs in a single JCL? Why don't you have a single job with 2 steps (Step A and B)

Quote:
I am required to run two jobs one after the other. However the second job is to be trigerred only if the
first job has ended successfully.


You can either make use of IF THEN or COND parameter. The best way is to have a single JCL with these 2 steps and a COND parameter.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Wed Oct 24, 2007 11:45 am    Post subject:
Reply with quote

Aaru,

Both the JCL's are two different jobs which in turn will be calling procs within itself.

So, i think it would be better if we can sutmble upon a scheduler. Correct me if I am wrong.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Oct 24, 2007 11:49 am    Post subject:
Reply with quote

Scheduler will be best option however, If scheduler is not there then, you can submit second job by adding IEBGENER step as last step of first job to send second job to INTRDR by checking return code of previous steps.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Oct 24, 2007 12:05 pm    Post subject: Reply to: Subsequent Job runs
Reply with quote

You can also add a step executing IKJEFT01 to submit the next job.

Code:
// IF RC < 5 THEN                                 
//SCHSTEP  EXEC PGM=IKJEFT01                       
//SYSTSPRT DD   SYSOUT=*                           
//SYSPRINT DD   SYSOUT=*                           
//SYSTSIN  DD   *                                 
 SUB 'YOUR.PDS.SECOND.JCL(MEMBER)'   
/*                                                 
// ENDIF 
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Wed Oct 24, 2007 1:13 pm    Post subject:
Reply with quote

Hi Aaru,

Thank you for your solution.

The Solution provided by you is working fine.

I have checked the same.
Back to top
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Wed Oct 24, 2007 5:10 pm    Post subject:
Reply with quote

Can you submit the jobs with Same JOb Card , It will run first job and after complete it , it start running the second one.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Wed Oct 24, 2007 5:12 pm    Post subject:
Reply with quote

Yes I can submit the job with the same JOB card.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Oct 24, 2007 5:17 pm    Post subject: Reply to: Subsequent Job runs one after the other
Reply with quote

Ram,

Quote:
Can you submit the jobs with Same JOb Card , It will run first job and after complete it , it start running the second one.


I doubt this. If there are 2 JOB cards in a JCL then both the jobs would be submitted after issuing the SUB command. The second job would not wait for the first one to get completed.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 6:59 pm    Post subject:
Reply with quote

Aaru,

Quote:
I doubt this

You are correct. There is no reason to doubt.

Quote:
The second job would not wait for the first one to get completed.

If the both job names are similar, one waits for another completion. Please note in this situation, we can't predict which one kicks off (executes) first.

Also its VERY BAD IDEA to have more than ONE job card in any member (unless there is strong reason for having such member).
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 log file runs out of space, an error ... sravindra_s JCL & VSAM 4 Thu Jul 17, 2014 1:09 pm
No new posts subsequent add versioning results SQL... Auryn DB2 2 Thu Apr 17, 2014 6:02 pm
No new posts Group with previous and subsequent re... scorp_rahul23 DFSORT/ICETOOL 31 Sat Jun 08, 2013 4:00 pm
No new posts Job abebds with S0C4 ,REASON=10 and r... Anuj Dhawan ABENDS & Debugging 3 Thu Jul 19, 2012 5:00 pm
No new posts CA7 set up to make sure job always ru... useit CA Products 11 Mon May 28, 2012 3:21 pm


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