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

How to get the return code of the exactly previous step?


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

New User


Joined: 20 Aug 2007
Posts: 11
Location: Canada

PostPosted: Thu Apr 10, 2008 6:27 pm
Reply with quote

Hi,

I know that when we use COND parameter as COND=(0,NE) in a step, the condition will be checked against return code of all the previous steps executed.

But my requirement is to check the return code of only the previous step.

I can,t use the step name in COND parameter because my JOB has duplicate step names.

Can any body help me out on this.

Thanks,
Pavan Hassaji.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 10, 2008 6:29 pm
Reply with quote

The answer is very well documented in the JCL reference manual
Back to top
View user's profile Send private message
pavankumarhassaji

New User


Joined: 20 Aug 2007
Posts: 11
Location: Canada

PostPosted: Thu Apr 10, 2008 6:35 pm
Reply with quote

I checked the manual, it is same that the condition is checked against all the previous steps, not only the immidiate previous step.

My requirement is to get the condition of only previous step.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Apr 10, 2008 6:39 pm
Reply with quote

Sounds like a good reason for unique step names!
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Apr 10, 2008 7:08 pm
Reply with quote

Yes, a problem as the CC check only does the first occurence of any given step name.
Back to top
View user's profile Send private message
pavankumarhassaji

New User


Joined: 20 Aug 2007
Posts: 11
Location: Canada

PostPosted: Thu Apr 10, 2008 7:28 pm
Reply with quote

According to to the manual, in 16th chapter. the following info i could find

"stepname
Identifies the EXEC statement of a previous job step that issues the return
code to be used in the test. If the specified step is in a procedure, this step
must be in the same procedure. Otherwise, the specified step must not be in a
procedure; the specified step must contain a PGM keyword, rather than invoke
a procedure.
If you omit stepname, the code you specify is compared to the return codes
from all previous steps. If the return code issued by any of those previous steps
causes the test condition to be satisfied, the system evaluates the COND
parameter as true and bypasses the job step.
If this step is invoked in JCL that runs as a started task, see “Stepnames for
Started Tasks” on page 16-2 for information about the stepname the system
assigns."

AND at another place i could find the following.

"Summary of COND Parameters
Figure 16-1. Execution or Bypassing of Current Step Based on COND Parameter
Test in COND Parameter
Return Code (RC) from a Previous Step
Execute Current Step Bypass Current Step
COND=(code,GT) RC >= code RC < code
COND=(code,GE) RC > code RC <= code
COND=(code,EQ) RC ¬= code RC = code
COND=(code,LT) RC <= code RC > code
COND=(code,LE) RC < code RC >= code
COND=(code,NE) RC = code RC ¬= code
Note: When the COND parameter does not name a previous step, the system tests all previous
steps. If any test is satisfied, the system bypasses the current step.
"

Apart from this if you know more info to solve my problem, please provide me with info.

Thanks,
Pavan Hassaji.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 11, 2008 1:13 am
Reply with quote

Hello,

Quote:
Apart from this if you know more info to solve my problem, please provide me with info.
Change the job to have unique step names. In addition to condition code testing problems, using the same step name in multiple steps can make restarting the job a nightmare.

Most sites will not promote a job to production if it contains duplicate step names.
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top