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

Regarding Condition codes


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

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Fri Aug 08, 2008 9:46 pm
Reply with quote

Hi,

I need to execute step3 depending on the Return codes of previous two steps step1 and step2.

step3--should not execute when both step1 and step2 return code is 4.
when any one of the step has a return code other than 4,step3
should run.

Please provide me the condition code needed for this.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Aug 08, 2008 10:22 pm
Reply with quote

Have you looked at the COND Syntax?
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Fri Aug 08, 2008 10:27 pm
Reply with quote

Hi,

I have tried and able to get the solution.

i want to code the condition like below

// If step1.rc not equal to 4 OR Step2.rc not equal e
//step3 exec
//.....
// endif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Aug 08, 2008 11:28 pm
Reply with quote

Take a look at Examples of IF/THEN/ELSE/ENDIF Statement Construct and Using the IF/THEN/ELSE/ENDIF Statement Construct and post back with your best guess......
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Aug 08, 2008 11:47 pm
Reply with quote

You first said BOTH steps must be CC=4 to run step3. Your sample code says OR.

Which do you want?
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Aug 08, 2008 11:49 pm
Reply with quote

Bill Dennis wrote:
You first said BOTH steps must be CC=4 to run step3. Your sample code says OR.

Which do you want?
Oops. I was backwards. You said "BOTH steps must be CC=4 to skip step3". Is it OR or AND?
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Sat Aug 09, 2008 12:15 am
Reply with quote

I said step3 should not run only when both steps step1 and step2's return codes are 4.

my sample code is
// If step1.rc not equal to 4 OR Step2.rc not equal 4
//step3 exec
//.....
// endif

when step1 rc=4 and step2 rc=0
If step1.rc not equal to 4 OR Step2.rc not equal 4
step 3 will exexute

when step1 and step2 both rc=4
If step1.rc not equal to 4 OR Step2.rc not equal 4
both these condition will be false,so step3 will not execute
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Sat Aug 09, 2008 3:04 am
Reply with quote

You have almost coded the solution yourself.
Code:
//        IF (STEP1.RC ^= 4 OR STEP2.RC ^= 4) THEN     
//STEP03  EXEC PGM=xxxxx                             
//        ENDIF                                             
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Mon Aug 11, 2008 11:11 am
Reply with quote

Bill Dennis wrote:
You have almost coded the solution yourself.
With the exp. level & exposure you own You guys are supportive enough. Thanks for being here... icon_smile.gif
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Tue Aug 12, 2008 12:07 am
Reply with quote

Hi,

when i tried the below code,i am getting Error that ^-should not be used with IF.
// IF (STEP1.RC ^= 4 OR STEP2.RC ^= 4) THEN
//STEP03 EXEC PGM=xxxxx
// ENDIF
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Aug 12, 2008 12:29 am
Reply with quote

Hello,

I believe the jcl checker may be looking for x'5F' rather than x'B0'. . .

Code:
 ¬  ^
 544B
 F000


If i remember, you could use NOT instead of the not symbol.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Tue Aug 12, 2008 1:56 am
Reply with quote

Try NE instead of ^=.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Tue Aug 12, 2008 1:58 am
Reply with quote

... or look it up in the JCL manual.
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 Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts AI writing DFSORT, REXX codes.. All Other Mainframe Topics 3
Search our Forums:

Back to Top