View previous topic :: View next topic
|
Author |
Message |
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Hi Aaru,
Thank you for your solution.
The Solution provided by you is working fine.
I have checked the same. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
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 |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Yes I can submit the job with the same JOB card. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Aaru,
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 |
|
|
|