Re: How to find the greatest of two numbers without using the comparison operators?



On 8/31/2007 at 12:41 AM, in message
<1188542463.524263.317700@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Aparajita<aparajita.mohanty@xxxxxxxxx> wrote:
Hi,

I want to find the greatest of two given numbers say 'A' and 'B.
The condition is that I should use the IF clause but not comparison
operators like '<', '>','=' etc.
Is there any other operator in COBOL by which we can compare two
numbers.

Not sure why you need this, but perhaps FUNCTION MAX could give you what you
want?

COMPUTE MAX = FUNCTION MAX(A B)

Well, I guess there's no IF in that.

I guess the POSITIVE usage others have given is the answer.

Frank

.