Force a return Code

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Force a return Code

Postby maragatham pp » Mon May 23, 2011 1:01 pm

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:

// IF STEP01.RC = 8 THEN

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

Please advice.
maragatham pp
Posts: 19
Joined: Fri May 20, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Force a return Code


Re: Force a return Code

Postby NicC » Mon May 23, 2011 1:06 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2511
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 86 times

Re: Force a return Code

Postby Robert Sample » Mon May 23, 2011 3:16 pm

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.
Robert Sample
Global moderator
Posts: 3099
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 176 times

Re: Force a return Code

Postby dick scherrer » Mon May 23, 2011 11:55 pm

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 . . .
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Re: Force a return Code

Postby BillyBoyo » Tue May 24, 2011 2:56 am

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.
Global moderator
Posts: 3733
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 254 times

Return to JCL


  • Related topics
    Last post