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

Problem in executing a step based on return code


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

New User


Joined: 12 Apr 2008
Posts: 36
Location: NOIDA

PostPosted: Wed Feb 17, 2010 5:01 pm
Reply with quote

Hi , I have a step in JCL which is executing based on if condition

IF ((S2.RC NE 6 AND S6.RC NE 7 AND S2.RC NE 1) AND S7.RC EQ 2) THEN
S8 EXEC PGM=IKJEFT01
*
SYSTSPRT DD SYSOUT=*
SYSTSIN DD DSN=&&PRTCRD,DISP=(SHR,PASS)
DELETE DD DSN=&CKA61.test,DISP=(OLD,DELETE,DELETE)
ENDIF

Now mine requirement is like , before this step there is step S6.
When S6 is getting flushed out then this step is not executing because of AND condition S6.RC NE 7 .So I changed it to OR condition.
IF ((S2.RC NE 6 OR S6.RC NE 7 AND S2.RC NE 1) AND S7.RC EQ 2)

I do not want to run this step when S6 return code is 7 then this step should not execute.which is not executing when
IF ((S2.RC NE 6 AND S6.RC NE 7 AND S2.RC NE 1) AND S7.RC EQ 2)



So I want to give a condition when S6 gets flushed out then this step should execute and When return code of S6 is 7 then this step should not
execute.

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Feb 17, 2010 5:09 pm
Reply with quote

I suggest that you hit the "IBM Manuals" button at the top of any page and then read the chapter on IF/THEN/ELSE/ENDIF processing.

What you want can indeed be accomplished using these, you just need to read some more and then try again.
Suggest you pay some attention to the RUN parameter.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Feb 18, 2010 2:15 pm
Reply with quote

And as i told someone else before:

Please read about the IF Statement in JCL.
So you don't need thesse unreadable COND anymore.
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top