× 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.



John,

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. Arrays are limiting in that I have to know the size at compile time and there is a total size limit. I know I can create a dynamic array but if I'm going to go to that much trouble I would use a use index instead.

More straightforward is probably creating a keyed PF with the desired fields
and dumping the flat file into that. (Or the SQL equivalent.)

Speed is critical to this process. This option was considered but I am trying to avoid moving large numbers of records around unless I have to.

... 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.

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.

BTW, I am familiar with FMTDTA. I just don't have the specifications memorized anymore.


-----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.



Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.