Page 1 of 1
What is the diff between Return code and Condition code?
Posted: Mon Nov 17, 2014 3:51 pm
by bizzy007
Hi,
I was asked in an interview "whats the difference between Return code and Condition Code"? I thought I knew it but I got confused with tese two, can you please help me with an explanation and when is what applicable? Appreciate any reply on this.
Thanks.
Re: What is the diff between Return code and Condition code?
Posted: Mon Nov 17, 2014 8:15 pm
by Robert Sample
A return code is passed from a called program back to the calling program. This can occur between two programs within a language or from the program to the operating system. A condition code only exists with JCL and represents a return code passed from the program to the operating system.
Re: What is the diff between Return code and Condition code?
Posted: Tue Nov 18, 2014 9:41 am
by bizzy007
That means Return-codes do not have a meaning away from programs?
Re: What is the diff between Return code and Condition code?
Posted: Tue Nov 18, 2014 8:15 pm
by Robert Sample
Precisely -- without a program, how can you have a return code?
The utility IDCAMS somewhat muddies the water, though, as the command response code is referred to as a condition code. It is a return code from the command, though.
Re: What is the diff between Return code and Condition code?
Posted: Tue Nov 18, 2014 9:58 pm
by DL1
Return code is the value in R15 when you return control to your caller.
Cond code (as in JCL) is the value in R15 (0 < cc < 4096) when your program terminates and returns control to z/OS.