View previous topic :: View next topic
|
Author |
Message |
love_vk
New User
Joined: 05 Apr 2006 Posts: 4
|
|
|
|
Hi,
There are 3 steps in my JCL
say
step1
step2
step3
what condition code should I use in step 3 to cater following requirements:
1. if step1 abends step3 should not execute
2. if step1 executes properly and step2 abends then step3 should execute.
3. if step1 and step2 both executes properly then step3 should also execute.
that is
It doesn't matters whether step2 runs or not, step3 should run if step1 had run successfully.
I don't want to use If-end if clauses........I just wanna use condition code in step3.
plz reply me asap
thanks |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Code: |
STEP1
STEP2
STEP3,COND=(0,NE,STEP1) |
Regards,
Priyesh. |
|
Back to top |
|
|
love_vk
New User
Joined: 05 Apr 2006 Posts: 4
|
|
|
|
Hi priyesh
it does not satisfying condition 2
if step1 executes properly and step2 abends then step3 should execute.
Thanks |
|
Back to top |
|
|
vasanthanc
New User
Joined: 01 Apr 2005 Posts: 58
|
|
|
|
Quote: |
that is
It doesn't matters whether step2 runs or not, step3 should run if step1 had run successfully.
|
Code by Priyesh satisfies this |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
hy love_vk,
you say: it does not matter what will happen with step2.
therefore why this is not satisfying condition 2?
Priyesh writes:
skip step3 if the returncode received from step1 is not equal 0,
i.e. step1 has abended
martin9 |
|
Back to top |
|
|
love_vk
New User
Joined: 05 Apr 2006 Posts: 4
|
|
|
|
Hi,
Now say if step1 executes properly(cc=0) and step2 abends then with condition code provided by priyesh step3 will not be executed. It will be bypassed.
Thanks |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
hy love_vk,
ok, then put step2 at the end of the job,
this is most simple.
martin9 |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
love_vk,
If STEP1 is ran fine & STEP2 abended in between, all successor job steps would be FLUSHED. It doesn't depend on COND code given in STEP3(apart from EVEN & ONLY).
So if your STEP3 any way doesn't depend on STEP2 and you have to satisfy all the three conditions too... then try exploring possibilities of changing places for STEP2 & STEP3.
means STEP1, STEP3 and then STEP2.
Else all thses 3 conditions cant be satisfied with COND parm alone.
Regards,
Priyesh. |
|
Back to top |
|
|
balusengodan
New User
Joined: 01 Mar 2005 Posts: 15 Location: chennai
|
|
|
|
hi if i am wrong please correct me
suppose if a step in a job gets abended means it will not execute the rest or remaining steps present in that job.
right.
if this is the case how the step 3 of your program will execute if the step 2 gets abend
it will stop execute the rest of the steps right
if this is wrong please mail me the correct answer to me
waiting for your reply
thanks
balu.s |
|
Back to top |
|
|
love_vk
New User
Joined: 05 Apr 2006 Posts: 4
|
|
|
|
I Think I have to use If Else Clause
I hav used the following now
If (step1.RC = 0) Then
//step3
cond=even
end if
Plz let me know if i m doing something wrong here
Thanks |
|
Back to top |
|
|
|