While I'm sure FMTDTA is fine, it sounds like it wouldn't be
all that hard to read the whole flat file into an array and
sort it in memory.

I don't really think this is a feasible approach in this case.
Current volume exceeds 100,000 records and will be growing.

I hadn't expected there to be so many records, since you said it was a
directory listing.

...  If you have access to the Unix box
that's generating this, there are plenty of tools there for
sorting.  If you must do all your processing on the AS/400,
there is always my favorite, iSeries Python.

To be more precise I am running the Unix command on the
iSeries to create a list of files in an IFS directory.  My
understanding of Python is that it is a web oriented language.
 This will be a batch process on the iSeries.  I don't think
Python fits here.

Python is a general-purpose language. It's actually not particularly
Web-oriented, though it is a perfectly good choice for Web development
(it is often used as the 'P' in the LAMP stack). Honestly, it's a
good choice for almost anything. I keep mentioning it precisely
because it seems most of the iSeries community is underinformed about
this language.

In the case of the iSeries, Python is particularly well-suited to a
task like yours because it can get the directory listing itself; then
you will have the data in a convenient, already-parsed data structure
in memory and skip the piping step. You can then easily sort the data
structure in memory and write out the result however you like, be it
an OS/400 physical file or an IFS file.

I had originally discounted the SQL solution because of having to
substring the record to get the pieces I need, both for sorting and
processing.  Considering the difficulties I am encountering using
QLGSORT and the age of the FMTDTA documentation I think I'm
going to go with a SQL solution.

In your case, SQL will probably get you home fastest, because you
already have it and you already know it. If you knew Python, I
suspect it would be quicker and more straightforward in iSeries
Python.

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.