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

What condition code should I use


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
love_vk

New User


Joined: 05 Apr 2006
Posts: 4

PostPosted: Wed Apr 05, 2006 12:41 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Apr 05, 2006 12:58 pm
Reply with quote

Code:
STEP1
STEP2
STEP3,COND=(0,NE,STEP1)


Regards,
Priyesh.
Back to top
View user's profile Send private message
love_vk

New User


Joined: 05 Apr 2006
Posts: 4

PostPosted: Wed Apr 05, 2006 1:56 pm
Reply with quote

Hi priyesh

it does not satisfying condition 2
if step1 executes properly and step2 abends then step3 should execute.


Thanks
Back to top
View user's profile Send private message
vasanthanc

New User


Joined: 01 Apr 2005
Posts: 58

PostPosted: Wed Apr 05, 2006 2:05 pm
Reply with quote

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
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Wed Apr 05, 2006 2:09 pm
Reply with quote

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
View user's profile Send private message
love_vk

New User


Joined: 05 Apr 2006
Posts: 4

PostPosted: Wed Apr 05, 2006 2:19 pm
Reply with quote

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
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Wed Apr 05, 2006 2:25 pm
Reply with quote

hy love_vk,

ok, then put step2 at the end of the job,
this is most simple.

martin9
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Apr 05, 2006 2:25 pm
Reply with quote

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
View user's profile Send private message
balusengodan

New User


Joined: 01 Mar 2005
Posts: 15
Location: chennai

PostPosted: Mon Apr 10, 2006 7:05 pm
Reply with quote

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
View user's profile Send private message
love_vk

New User


Joined: 05 Apr 2006
Posts: 4

PostPosted: Tue Apr 11, 2006 11:07 am
Reply with quote

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
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top