Re: Cobol Linear search Vs Perfrom Until

From: LX-i (lxi0007_at_netscape.net)
Date: 07/17/04


Date: Sat, 17 Jul 2004 16:48:50 -0500

Glenn Someone wrote:

> On 17 Jul 2004 09:53:48 -0400, docdwarf@panix.com wrote:
>
>
>>and all this peeking and poking about,
>>above and below, makes me... uncomfortable.'
>
>
> It really shouldn't. The way I see it is that a program design is
> getting introduced that is making you uncomfortable because it's
> something different than what you've already encountered. If everyone
> had this attitude, computer science wouldn't be developing and moving
> its way forward and we'd still be in the Grace Murray Hopper days of
> punch cards.

Both Mr. Stevens and Mr. Klein have stated that the results are
undefined when you do a binary search on a table with duplicate keys.
Do you understand what "undefined" means, in the context of the COBOL
standard? With one vendor, they may code it to find the first in
sequence that matches. Another may choose to look at blocks, and if
they happen to find one that matches, they'll return it, even if it's 3
of 7 with the same key. It's entirely possible that a third vendor
could interpret the same condition as "I can't uniquely satisfy this
search, so I'm going to throw "at end"." What does that do to your
peek-and-poke strategy?

You claim to want the most stable, portable code, but in this case,
you're relying on undefined functionality to give you an acceptable
solution. THAT is what makes some folks here "uncomfortable" with it.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~   /   \  /         ~        Live from Montgomery, AL!       ~
~  /     \/       o  ~                                        ~
~ /      /\   -   |  ~          LXi0007@Netscape.net          ~
~ _____ /  \      |  ~ http://www.knology.net/~mopsmom/daniel ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~         I do not read e-mail at the above address           ~
~    Please see website if you wish to contact me privately   ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~