Re: Cobol Linear search Vs Perfrom Until
From: Richard (riplin_at_Azonic.co.nz)
Date: 07/18/04
- Next message: docdwarf_at_panix.com: "Re: Cobol Linear search Vs Perfrom Until"
- Previous message: Richard: "Re: Cobol Linear search Vs Perfrom Until"
- In reply to: Glenn Someone: "Re: Cobol Linear search Vs Perfrom Until"
- Next in thread: jerry: "Re: Cobol Linear search Vs Perfrom Until"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 17 Jul 2004 16:51:47 -0700
Glenn Someone <dontspamme@whydoyouneedmyaddressspammers.com> wrote
> Is that the assumption? Because it's something you've never seen, you
> assume it would blow up and not work.
The problem is not that it will 'blow up and not work', the problem is
that the results are not defined and may be different in the next
version, or from some other change.
> Have you ever heard of good sound testing?
Testing only provides results in the environments tested. If the
environment changes then undefined results may change.
> Like I said study what the binary search does (if
> SEARCH ALL doesn't cut it, provide a binary search, it's not that hard
> to code yourself!), and then you might get a little bit of ease out of
> it.
But that is not necessary. Adding a sequence is trivial, either at the
time the table is created or by a single serial pass to do this.
> >(row 1) AAA 0
> >(row 2) AAA 1
> >(row 3) BBB 0
> >(row 4) BBB 1
> >(row 5) BBB 2
> >(row 6) CCC 0
> >(row 7) CCC 1
> No. This is showing you don't have a conception of what a binary
> search is. Searching for BBB will return row 4 from a properly coded
> binary search, AAA row 2, CCC row 6. Then finding the first entry
> involves your sequential search option (using PERFORM UNTIL). I
> wouldn't personally go up and down from the spot discovered, because
> of that simplicity argument (I'd go find the first one and then
> process all records accordingly).
Adding the sequence and then SEARCH ALL '<key> 0' gives a reliable,
portable, _defined_ result of the first entry for <key> without having
to do your own search coding, or grubby -1, +1 shuffling.
- Next message: docdwarf_at_panix.com: "Re: Cobol Linear search Vs Perfrom Until"
- Previous message: Richard: "Re: Cobol Linear search Vs Perfrom Until"
- In reply to: Glenn Someone: "Re: Cobol Linear search Vs Perfrom Until"
- Next in thread: jerry: "Re: Cobol Linear search Vs Perfrom Until"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|