|
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.
More straightforward is probably creating a keyed PF with the desired fields
and dumping the flat file into that. (Or the SQL equivalent.)
... 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.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Tuesday, September 13, 2011 4:53 PM
To: Midrange Systems Technical Discussion
Subject: Re: QLGSORT and CPF3BD6 - Key field 01 is not valid for key number
1
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.
Yeah, you would need to do a little finagling (perhaps with data structures
and overlays) to set up the key, but it doesn't strike me as particularly hairy.
More straightforward is probably creating a keyed PF with the desired fields
and dumping the flat file into that. (Or the SQL equivalent.)
There are so many ways to skin this cat. 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.
But if you're not using those already, it's probably because you're not familiar
with them, and thus you are stuck in a similar position as with FMTDTA:
needing to do a bunch of reading to figure it out. I think the sweet spot in
terms of effort, complication, and total time to implement (including learning
if necessary) is the PF or SQL-based approach.
John
--
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-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.