For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2007 > Re: How to find the greatest of two numbers without using the









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to find the greatest of two numbers without using the
Frank Swarbrick

2007-08-31, 6:58 pm

>>> On 8/31/2007 at 12:41 AM, in message
<1188542463.524263.317700@i38g2000prf.googlegroups.com>,
Aparajita<aparajita.mohanty@gmail.com> 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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com