View previous topic :: View next topic
|
Author |
Message |
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
You can't. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
somasundaran_k
Active User
Joined: 03 Jun 2003 Posts: 134
|
|
|
|
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 |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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.......... .....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 |
|
|
Durga
New User
Joined: 13 Apr 2005 Posts: 3 Location: PUNE
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
You can't reset the Return Code but you can execute other step using cond=even. |
|
Back to top |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
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 |
|
|
LICMW
New User
Joined: 05 May 2005 Posts: 1
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
|