Who can think of quick ways to sort a file on a NON-key field?

 

Quick background: I have a menu file (option, program, description) that
I wanted to appear in the menu by program name.  Quick way out in my
mind: sort the physical file by program, then use SQL to set the option
equal to the relative record number - and voila the menu is in
alphabetical sequence.

 

Other options come to mind.  I could have removed the option number from
the file entirely and kept the program IDs in an array (or even in the
subfile itself if I didn't use page at a time processing).  This would
give me a lot more flexibility in ordering the records. That might not
be acceptable in a large ERP package where a specific menu option is
expected to always mean the same thing.

 

However, the way I chose worked, except that I couldn't find an easy
(i.e., single step) way to sort the records in a file based on an
arbitrary sort sequence.  I could have created a logical and sorted by
the logical, then deleted the logical.  I took the route of creating a
second file in QTEMP using STRSQL and doing a SELECT * ORDER BY on the
file, copying the temporary file back into the original and then
deleting the temp file.

 

Any other suggestions?

 

Joe

 


This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2026 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.