|
|
| Author |
Message |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Hey MGIndalco,
The step SUBMIT2..shud that be given after the JOB TERMINATION step or b4 that?
I mean shud this be the last step in the JCL?
Plz acknowledge.
Regards, |
|
| Back to top |
|
 |
References
|
|
 |
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 154
|
|
|
|
| andycool wrote: |
Hey MGIndalco,
The step SUBMIT2..shud that be given after the JOB TERMINATION step or b4 that?
I mean shud this be the last step in the JCL?
Plz acknowledge.
Regards, |
Yes, the Submit STEP should be the last step of every Job. |
|
| Back to top |
|
 |
anuradha
Global Moderator
Joined: 06 Jan 2004 Posts: 257
|
|
|
|
Hi Andycool,
SUBMIT2 step should be the last step of job1. So once the steps of job1 are finished JOB1 will execute the SUBMIT2 step which will submit the second job.
If the jobs are interrelated then we should give cond parameter too. |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Thanks for the comments guyz...
I appretiate your help. |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Hi Guys,
As per your above comments the SUBMIT2 step will be the last step. As i am chaining here a series of jobs, it will be necessary for me to keep a track of Return Codes. For instance:
===========================================
Job1step1
Job1step2
Job1step3
Job1SUBMIT2 //this will submit the job JOB2
Job2step1
Job2step2
Job2step3
Job2SUBMIT3 //this will submit the job JOB3
==========================================
As illustrated above if i want to chk a condition that :
If the RC of Job1 = 0 then only proceed with the step Job1SUBMIT2...how can i do this?
As i am chaining a series of jobs, this check will be required to ensure that the previous job has finished successfully and the next job in the series can be submitted.
Regards, |
|
| Back to top |
|
 |
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 154
|
|
|
|
| andycool wrote: |
Hi Guys,
As per your above comments the SUBMIT2 step will be the last step. As i am chaining here a series of jobs, it will be necessary for me to keep a track of Return Codes. For instance:
===========================================
Job1step1
Job1step2
Job1step3
Job1SUBMIT2 //this will submit the job JOB2
Job2step1
Job2step2
Job2step3
Job2SUBMIT3 //this will submit the job JOB3
==========================================
As illustrated above if i want to chk a condition that :
If the RC of Job1 = 0 then only proceed with the step Job1SUBMIT2...how can i do this?
As i am chaining a series of jobs, this check will be required to ensure that the previous job has finished successfully and the next job in the series can be submitted.
Regards, |
U can either use an IF statement like below,
IF Job1step3.RC=0 THEN
Job1SUBMIT2
ENDIF
Or
Job1SUBMIT2 EXEC PGM,PARM=(0,LT) |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Hey die7 thanks for that.
Please tell me if the below psuedo code is valid or not:
======================
Job1step1
Job1step2
IF Job1step2.RC <> 0 THEN // I want to continue execution of
// Job1tep3 even though Job1Step2
// is not properly executed.
Job1step3
ENDIF
Job1step3
IF Job1step3.RC = 0 THEN
Job1SUBMIT2
ENDIF
Job1SUBMIT2 //this will submit the job JOB2
Job2step1
Job2step2
Job2step3
Job2SUBMIT3 //this will submit the job JOB3
===========================================
Bottomline: To continue the job even though Job1Step2 is not properly executed. That is not to abend the job at any point of time. |
|
| Back to top |
|
 |
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 154
|
|
|
|
| andycool wrote: |
If the RC of Job1 = 0 then only proceed with the step Job1SUBMIT2...how can i do this?
|
Since u said u want to check it for 0 and only then proceed I coded it, taht way.
If u want to execute the STEP even though if it has some CC Greater than or Equal to Zero , the easiest way wud be to give COND=(0,GT). |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Hi Guys,
I have tried here to structure a job, considering all your inputs especially those from MGIndalco and Die7 in the thread. This is just the first job in the chain. It'll look like this:
==========================================
//Job1 JOB ...
//
//Job1step1
//
//Job1step2
//
//Job1step3
//
//JOB1SUBMIT2 EXEC PGM=IKJEFT01,
// COND=(0,GT),
// PARM='',DYNAMNBR=50,
// REGION=4096K
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
PROF PREFIX(ANDYCOOL)
SUBMIT 'ANDYCOOL.TEST.JOBS(JOB2)'
==========================================
This will submit the Job2.
The COND=(0,GT) will submit the JOB2 even though the prevoius job maxcc is not zero.
Please let me know if i am missing any segments here.
Also let me know, in the "PROF PREFIX(USERID)"; is the userid is my TSOid ?
Thanks in Advance, |
|
| Back to top |
|
 |
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 154
|
|
|
|
| Ya u shud be good to go, I hope u already know what u mean by the PROF command. It will prefix all unqualified Datasets with the prefix mentioned, that Id is ur TSO id. Make sure the Input files are all having the high level qualifier as ur TSO ID. |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Hi Die7,
I sucessfully ran a chain of two jobs using the above suggesstions given by you.
But there's more yet to come. I hope you are not bored solving the doubts
Thanks a lot !
Regards, |
|
| Back to top |
|
 |
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 154
|
|
|
|
| Anytime. |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Hi Die7,
Just when i thought it was over, yet a new doubt related to same topic.
Till this point i successfully ran a chain consisting of four jobs.
JOB1=>JOB2=>JOB3=>JOB4
This is working fine.
One of my requirement is, to get a msg in SYSOUT at the end of each job, like:
At the end of JOB1 in its sysout the msg shud be
"Msg- Job1 successful, proceeding to Job2"
and so on
Is there anyway i can get this.
Please let me know,
Thanks in Advance ! |
|
| Back to top |
|
 |
andycool
Active User
Joined: 12 Apr 2005 Posts: 65
|
|
|
|
Can anyone help me in this ?
Please respond !
Regards |
|
| Back to top |
|
 |
MGIndaco
Moderator
Joined: 10 Mar 2005 Posts: 478 Location: Milan, Italy
|
|
|
|
| Hi Andycool, I don't understand your request... are you looking for way to put a message as a WTO upon console? Or are you only looking for a way to append results of execution in another output? |
|
| Back to top |
|
 |
|
|