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

Reset Previous step's return code


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

Senior Member


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

PostPosted: Mon Mar 28, 2005 2:04 pm
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

Global Moderator


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

PostPosted: Mon Mar 28, 2005 4:36 pm
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: 1448
Location: Chicago, IL

PostPosted: Mon Mar 28, 2005 4:51 pm
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
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: 1448
Location: Chicago, IL

PostPosted: Mon Mar 28, 2005 10:58 pm
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
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
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: 1448
Location: Chicago, IL

PostPosted: Tue Mar 29, 2005 1:31 pm
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
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: 1448
Location: Chicago, IL

PostPosted: Fri Apr 15, 2005 9:04 am
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
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
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
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: 1448
Location: Chicago, IL

PostPosted: Thu May 05, 2005 9:52 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts purge jobs with return code 0 and ret... JCL & VSAM 4
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Mark Previous & next lines when a... DFSORT/ICETOOL 9
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top