Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to get the return code of the exactly previous step?
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 10, 2008 6:29 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 10, 2008 7:08 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Apr 11, 2008 1:13 am    Post subject:
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    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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us