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

Subsequent Job runs one after the other


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1287
Location: Chennai, India

PostPosted: Wed Oct 24, 2007 11:38 am
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
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: 691
Location: Earth

PostPosted: Wed Oct 24, 2007 11:49 am
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: 1287
Location: Chennai, India

PostPosted: Wed Oct 24, 2007 12:05 pm
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
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
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
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: 1287
Location: Chennai, India

PostPosted: Wed Oct 24, 2007 5:17 pm
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: 1436
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 6:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts SORT - To repeat a string in same col... SYNCSORT 3
No new posts JCL - To repeat a string in same colu... JCL & VSAM 2
No new posts Reading subsequent rows in a query. DB2 12
No new posts DB2 Query runs very long DB2 21
No new posts log file runs out of space, an error ... JCL & VSAM 4
Search our Forums:

Back to Top