|
FMTDTA
Paul Nelson
Arbor Solutions, Inc.
708-670-6978 Cell
pnelson@xxxxxxxxxx
"Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
11/18/2004 09:59 AM
Please respond to Midrange Systems Technical Discussion
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
cc:
Subject: Reordering a file
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 is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.