Page 1 of 1

What is the diff between Return code and Condition code?

PostPosted: Tue Jan 17, 2012 12:22 pm
by coollearner
I was askedn in one of the interviews "whats the difference between Return code and Condition Code"
Please let me know the meaning of these two terminologies and when they are applicable?

Re: What is the diff between Return code and Condition code?

PostPosted: Tue Jan 17, 2012 1:05 pm
by steve-myers
Unfortunately, it's sort of a trick question. A "return code," in JCL, is a numeric code with a value from 0 to 4095 left by a program when it is called by JCL. Most languages have a mechanism to set this return code. The terms "condition code" and "return code" are often used interchangeably in JCL.

Technically, the only proper use of the term "condition code" is to refer to a two bit value set by most of the machine instructions, but this value is never used by JCL, unless a program explicitly retrieves a "condition code" and returns it as a return code. In Assembler this is moderately difficult, and essentially impossible in any other language. In 40+ years I've never encountered a program that does any such thing.

Re: What is the diff between Return code and Condition code?

PostPosted: Tue Jan 17, 2012 5:40 pm
by coollearner
Thanks