Page 1 of 1

Force a return Code

PostPosted: Mon May 23, 2011 1:01 pm
by maragatham pp
Hi, My job executes FILEAID to copy certain records of a file into other. When there is no record found, matching the selection criteria this step returns RC 8.

But, my requirement is that, "no record found" situation is acceptable and the job has to end with RC 0.
I tried the below code:

//STEP01 EXEC PGM=FILEAID
.....
....
// IF STEP01.RC = 8 THEN
//STEP02 EXEC PGM=IDCAMS
//SYSPRINT DD=*
SET MAXCC = 0
// ENDIF

Although STEP02 was executed the RC from the job was 8.

Please advice.

Re: Force a return Code

PostPosted: Mon May 23, 2011 1:06 pm
by NicC
You cannot change the return code of a completed step. You will have to check the FIle-Aid documentation to see if you can pass a parameter or control card to set the return code to what you want. If you cannot then you are stuck with what you have - as per several other posts.

Re: Force a return Code

PostPosted: Mon May 23, 2011 3:16 pm
by Robert Sample
MAXCC changes only the return code for the IDCAMS step -- it does not affect the return codes of any other steps. As Nic said, once a step executes that return code is fixed and cannot be changed by anything.

Re: Force a return Code

PostPosted: Mon May 23, 2011 11:55 pm
by dick scherrer
Hello and welcome to the forum,

If you need something other than what a utility will provide, suggest you consider a small program that will function as you want . . .

Re: Force a return Code

PostPosted: Tue May 24, 2011 2:56 am
by BillyBoyo
As Nic and Robert have said, you can't change the value of a return-code from a completed step. Either, as Nic suggested, check out the File-Aid documentation to see if there is any way to "turn off" the return-code from there. Or, change whatever it is, either human or program, that is seeing the "08" for the job and not being happy. If you search this forum you'll see there was a big topic on this a few weeks back. What you want can't be done. So you have to come up with something else.