× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Using the right tool for the job is certainly a good maxim, and as you note scripting languages are often a better fit for this sort of thing, provided it's not a repetitive process.

I did want to point out though is that this part (determining the matching values) was actually the easier part. If I remember correctly, the original problem also required being able to match if there was exactly one difference, and that would require some serious fu, in whatever language.

I'd probably create an array representing all distinct values, then have one array for each category. I'd then start comparing arrays. First I'd determine all existing unique array combinations. That list would be used to print the "matching category" report.

Then the fun would occur! I'd compare each unique array with each additional unique array and count the differences. If there was only one, then I'd print a report showing the two sets of categories for each near-match.

In any event, I think it would be best done in a procedural language of some type, although one with dynamic arrays might be a little easier on the brain.

Joe

I know I'm joining in quite late, and in all likelihood the actual
task which prompted this thread is long completed. Still, I wanted to
mention another approach for anyone who stumbles across this problem
in the future:

What I would do is to resort to a very high-level language, such as
Python. Other modern scripting languages (such as Perl or Ruby, and
I'm sure there are plenty more) should work just as well, but I
specifically mention Python because there is a native iSeries version,
at<http://www.iseriespython.com>.

For fun, I wrote a program for this in iSeries Python:

<http://code.midrange.com/5f79a99cc2.html>

It's similar in length to Richard Casey's clever SQL solution, but for
those (like me) who lack the SQL-fu, the Python is easier to read and
write, and generally more sanity-preserving.

For those who are more comfortable with other scripting languages, it
would probably be worth it to just dump the data out to your Linux box
or PC, and then use the language of your choice there.

John


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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.