MVS JCL Return-code

5 pts.
Tags:
JCL
MVS
How do I pass pass a return-code of 4 back to MVS JCL?
ASKED: July 14, 2009  8:02 PM
UPDATED: January 27, 2010  3:07 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

What application are you running that issues the return-code.

There are several utility applications (IDCAMS, IEFBR14) which will allow you to pass cond-codes via JCL – I believe. I think if you try and delete a non-existant file using IEFBR14 (DISP=OLD,DELETE), it will finish, but issue a condition code. I think you can issue a cond-code using input values for IDCAMS also.

If it’s a COBOL, FORTRAN, PL1, etc. program, you can imbed logic in the code to generate a cond-code via the JCL. In COBOL, I think if you set the CONDCODE or RETURN-CODE (- system reservered word), this value will be passed via the JCL.

I haven’t worked in this arena in a while, but my memory seems to think this is how it can be done.

Regards
MM

—————————-

just a little more detail …

In a COBOL program:
<pre> MOVE 4 TO RETURN-CODE.
GOBACK.</pre>

In ASSEMBLER, set register 15 to the value you want as RC:
<pre> LA 15,4
BR 14</pre>

In some IBM utilities, like IDCAMS you can force the RC (this one sets the “condition code to 0) (cond code same as return code):
<pre>
//STEP00 EXEC PGM=IDCAMS
//SYSIN DD *
DELETE ‘PRATTST.FILOUT.DBA131′
SET MAXCC = 0
/*
</pre>

in a CLIST & REXX , specify the RC on the EXIT stmnt:
EXIT CODE(&RETCD)

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following