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
 

 

Reset Previous step's return code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Mar 28, 2005 2:04 pm    Post subject: Reset Previous step's return code
Reply with quote

Hi All,

Suppose If S010.RC = 08. And before executing S020 I want to reset S010.Rc to 0. How can I do that ?

Regards,

Priyesh
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Mar 28, 2005 4:36 pm    Post subject: Re: Reset Previous steps return code
Reply with quote

You can't.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Mar 28, 2005 4:51 pm    Post subject: Re: Reset Previous steps return code
Reply with quote

superk wrote:
You can't.


So Is there any other way (writing a COBOL program in between S010 & S020) than doing thru JCL.

Or this is not at all possible to reset the return code of previous step to 0.

Regards,

Priyesh.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Mon Mar 28, 2005 10:51 pm    Post subject: Re: Reset Previous step's return code
Reply with quote

priyesh.agrawal wrote:
Hi All,

Suppose If S010.RC = 08. And before executing S020 I want to reset S010.Rc to 0. How can I do that ?

Regards,

Priyesh


U can do it using IDCAMS STEP

//S015 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SET LASTCC = 0
/*

If you want to SET the CC to 0 only if the LAST CC=8 then you can code IF LASTCC = 8
THEN
DO
SET LASTCC = 0
END
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Mar 28, 2005 10:58 pm    Post subject: Re: Reset Previous step's return code
Reply with quote

But coding S015 with LASTCC will not make any effect on the RC of S010.

And I want to change S010.RC

S015 coded with setting LASTCC=0, will only setting S015.RC=0.

Please comment ....whether I m correct...

Regards,

Priyesh
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Mon Mar 28, 2005 11:19 pm    Post subject:
Reply with quote

Priyesh
As Superk mention it's not possible.
There is no method for resetting the COND CODE for a step that has already finished.

hth
-Som
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Mar 29, 2005 12:27 am    Post subject: Re: Reset Previous step's return code
Reply with quote

priyesh.agrawal wrote:
But coding S015 with LASTCC will not make any effect on the RC of S010.

And I want to change S010.RC

S015 coded with setting LASTCC=0, will only setting S015.RC=0.

Please comment ....whether I m correct...

Regards,

Priyesh


Sorry Priyesh You are right. I misguided u, r u going to execute any STEP based on the RC of S010 or why do u want to set it to 0 . Just curious...
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Mar 29, 2005 1:31 pm    Post subject: Re: Reset Previous step's return code
Reply with quote

Quote:

Sorry Priyesh You are right. I misguided u, r u going to execute any STEP based on the RC of S010 or why do u want to set it to 0 . Just curious...


So Finally.....it isn't possible.......... icon_sad.gif .....actually the step I'm trying to execute after previous step is a PROGPROC, which doesn't allow any RC > 0 from previous steps......and most of the time I'm getting 08 from previous step.....so thats why I was willing to set it 0 before executing PROGPROC.

Well, thanks a lot for putting all your efforts.

Regards,
priyesh
Back to top
View user's profile Send private message
Durga

New User


Joined: 13 Apr 2005
Posts: 3
Location: PUNE

PostPosted: Fri Apr 15, 2005 8:42 am    Post subject: Return Code can be changed using COBOL
Reply with quote

Hi Priyesh,
We can change the return code in cobol program by setting the value of RETURN-CODE to 0. RETURN-CODE is a register which has the value of previous step return code. So by setting this register to 0 the return code of step01 will be changed.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Apr 15, 2005 9:04 am    Post subject: Re: Return Code can be changed using COBOL
Reply with quote

Hi Durga,

Not very sure about what you said. I am again making it clear, S010 has been executed completly with RC=08 (Let it be IDCAMS). Now Before executing S020 (suppose PROGPROC), I'll have to reset S010.RC to 0.
Acc to you it is possible by inserting another step S015 with a program in COBOL, resetting the RC registor's Value to 0.....Is that what you said, If yes can you please send me the code of getting it done.

Thanks & Regards,

Priyesh
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Apr 15, 2005 6:18 pm    Post subject:
Reply with quote

You can't reset the Return Code but you can execute other step using cond=even.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Sat Apr 16, 2005 1:26 am    Post subject: Re: Return Code can be changed using COBOL
Reply with quote

priyesh.agrawal wrote:
Hi Durga,

Not very sure about what you said. I am again making it clear, S010 has been executed completly with RC=08 (Let it be IDCAMS). Now Before executing S020 (suppose PROGPROC), I'll have to reset S010.RC to 0.
Acc to you it is possible by inserting another step S015 with a program in COBOL, resetting the RC registor's Value to 0.....Is that what you said, If yes can you please send me the code of getting it done.

Thanks & Regards,

Priyesh


Priyesh,
Resetting a Completed Steps CC is not possible, but you can make PROGPROC run when you get RC other than 0 , by setting the COND Parm accordingly.

Now my question is R u not able to set the COND parm of the PROGPROC STEP.

You also Check for an IF condition to allow PROGPROC execute when you get either 0 OR 8, like below

IF STEP010.RC=0 OR 8 THEN
STEP020 PROGPROC
ENDIF
Back to top
View user's profile Send private message
LICMW

New User


Joined: 05 May 2005
Posts: 1

PostPosted: Thu May 05, 2005 9:45 pm    Post subject: Re: Reset Previous step's return code
Reply with quote

Priyesh,

Yes, it is possible to set a step's return code within the cobol program that the step is exeuting.

At the end of the program that is currently being executed, you will set the RETURN-CODE to whatever you need it to be set to.

For example - if you have STEP0001 and STEP0002 in your JCL and STEP0002 depends on the RC of STEP0001, you can do the following:

Within the program executed by STEP0001....

Prior to your STOP RUN (or whichever point you are about to end execution and know that you are not going to abend) insert this:

MOVE 11 TO RETURN-CODE (or whatever rc you need)

So in your case, you will MOVE 0 TO RETURN-CODE at whatever point you know there is no abend.

Then in your JCL, check for RC=0 as normal.

Hope that helps.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu May 05, 2005 9:52 pm    Post subject: Re: Reset Previous step's return code
Reply with quote

LICMW,

Firstly Many Thanks for putting effort towards it.

But My query was "Can we reset RC of an already executed step ?"

For that I got reply as "NO".

In your way, first step is not completed, & RC is being set within the execution of first step.

Think I m clear.

Regards,

Priyesh.
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