View previous topic :: View next topic
|
Author |
Message |
sunnyma
New User
Joined: 25 Jul 2007 Posts: 3 Location: ohio
|
|
|
|
Hi
Am trying to wrapup a job based on a condition of a previous step.I do not want to abend the job with any userabends but want a clean return code.
Here is what I want:
\\STEP A
\\STEP B
\\STEP C
\\STEP D
All I want to do is to wrap up the job if suppose STEP A return me macc 4
and do not want to execute step b,c,d.
STEP B ,C and D already have COND parameters so its not very good to have more conditions.
Can I have a step added btwn STEP A and B so that it checks for A's return code and skip the rest of the jcl and dont execute them at all.
I have tried STOPEXEC but it shoots a user abend U0076 which I do not want.
Appreciate your help on this. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
sunnyma wrote: |
Hi
Am trying to wrapup a job based on a condition of a previous step.I do not want to abend the job with any userabends but want a clean return code.
Here is what I want:
\\STEP A
\\STEP B
\\STEP C
\\STEP D
All I want to do is to wrap up the job if suppose STEP A return me macc 4
and do not want to execute step b,c,d.
STEP B ,C and D already have COND parameters so its not very good to have more conditions.
Can I have a step added btwn STEP A and B so that it checks for A's return code and skip the rest of the jcl and dont execute them at all.
I have tried STOPEXEC but it shoots a user abend U0076 which I do not want.
Appreciate your help on this. |
Look at the IF statement in the JCL Manual. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
sunnyma wrote: |
Can I have a step added btwn STEP A and B so that it checks for A's return code and skip the rest of the jcl and dont execute them at all. |
No. Based on your limitations, I'd suggest moving steps B,C, and D to another job. Then, you can run/not-run that job based on the return-code of STEPA. |
|
Back to top |
|
|
sunnyma
New User
Joined: 25 Jul 2007 Posts: 3 Location: ohio
|
|
|
|
Thanks Kevin and Craq ,but I was looking for a solution within the same jcls as thats also one of my limitations,I would like to wrap up this job only without a user abend code. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
STEP B ,C and D already have COND parameters so its not very good to have more conditions. |
Who made this "rule"? It is quite common for multiple condition codes to be tested.
The way to
Quote: |
skip the rest of the jcl |
is to test condition code(s) and bypass step(s) accordingly. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
so its not very good to have more conditions. |
What' s wrong in having all the conditions You need..
I agree that the cond parameter is not friendly,
but why not use the "// IF" constructs,
they are more friendly and easy to understand |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
sunnyma wrote: |
Thanks Kevin and Craq ,but I was looking for a solution within the same jcls as thats also one of my limitations,I would like to wrap up this job only without a user abend code. |
I'm not sure what you mean by user abend code, a nonzero return code is not a user abend. You add an if statement between steps A and B just to skip the rest of the depending on the RC of step A. |
|
Back to top |
|
|
sunnyma
New User
Joined: 25 Jul 2007 Posts: 3 Location: ohio
|
|
|
|
Craq your suggestions worked for me thanks a lot |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
sunnyma wrote: |
Craq your suggestions worked for me thanks a lot |
Your welcome |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Did I miss something?
I thought the original post said that there should be no more condition code checks added? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi sunnyma,
You could also code a COND in the JOB stmt. When any step issues a RC that satisfies the JOB stmt COND the JOB execution terminates, by-passing the remaining steps. |
|
Back to top |
|
|
|