|
I'm looking for ideas and can't think of anything straightforward. I've been tasked with sorting an input parameter (50 element char array) to a rpgle program. We're on 7.1. They are to be sorted based on a sort order in a file keyed by the individual element value. The array could have only one or two elements - the rest blank or all of them filled. Not all the elements are in the file, they can be sorted after the important elements in any order. There's only a few that are order dependent.
So an array like this:
ABC CAR DOG CAT THS THT MOR LES ... ... ... ...
With a sequence file (has many other fields and records not used by this process) like this:
DOG 1
CAT 2
CAR 5
XYZ 6
ABC 0
THT 0
ZZZ 0
Should be processed like this (order after CAR is not important):
DOG CAT CAR THS THT MOR LES ABC
Putting 999 into sortkey of the unimportant elements is a maintenance issue - someone someday will leave it zero and it will sort to the front. Reverse order sorting and setting DOG as 999 is possibility tho easily confusing at first. I'd like to KISS but it has to be reasonably efficient as the program is called constantly from a java web process so someone is waiting on the other end of the enter key.
Any suggestions?
TIA
Jack
This email, including any documents, files, or previous email messages attached to it, has been sent from an email account of College Foundation Inc., (CFI) and may contain confidential, proprietary, or legally privileged information belonging to CFI. If you are not the intended recipient, any dissemination, distribution, or copying of this email or its attachments is strictly prohibited. If you have received this email in error, please immediately notify the sender by email and destroy the original email and any attachments.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.