1) Mark,  'Straight RPG' would be a shoehorn.  You would need a logical
file to perform the sort.

2)  Joe, There is no such thing as a one line OPNQRYF.  You need the OVRDBF
and the rest of the kludge.  New people find SQL easy to use.  OPNQRYF's
crud about FILE vs. FORMAT, and which one do you declare in your RPG
program is for people who need a testosterone rush, and this does it for

3)  I think Alexei's solution was the most simple and straight forward.

4)  And as far as would a dba understand rank - well, yes - BUT then they
might wonder what criteria determined the ranking.  My point is this:  If
you need this for a report then don't use the rank field, you can already
sort by year and then dollar amount.  But I would be willing to compromise
if what you wanted was better response time upon an inquiry.  And on the
inquiry you wanted to display rank.  Why you would want that on an inquiry
I don't know.  Gee, if you are in our top 25 then you get a better volume

5)  I've written UDF's.  However I fail to see how you would get an
acceptable response time by using one to interactively determine rank.  I
am NOT saying that UDF's are bad for performance.  What I am saying is that
the each determination of rank would have to process the entire file and
that is the killer.

Rob Berendt
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.