Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What condition code should I use

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: What condition code should I use
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: 1452
Location: Chicago, IL

PostPosted: Wed Apr 05, 2006 12:58 pm    Post subject: Re: condition codes
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Wed Apr 05, 2006 2:25 pm    Post subject: Re: condition codes
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    Post subject:
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    Post subject: condition codes
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us