Tim:

Since I have no good idea how you'd sort a CSV file on UNIX, I'm not sure what 
you can do on the iSeries to make it any easier. The short example you supplied 
doesn't make clear whether fields in every line have the same width. You also 
don't describe whether you want to sort entire lines or just specific columns. 
You have apparently MM/DD/YYYY dates, but maybe you're only sorting by the 
first field.

If the columns aren't fixed-width, I'd probably just pass them all in to the 
QLGSORT API (and possibly QLGSORTIO) as lines in the input buffer and pull the 
lines from the output buffer before formatting specifically for any printing or 
other output and be done with it.

If they are fixed-width, you could still call QLGSORT against a flat physical 
file rather than a spooled file or even use FMTDTA. You do understand that you 
can override STDOUT to a physical file -- no apparent need for a spooled file?

Tom Liotta

midrange-l-request@xxxxxxxxxxxx wrote:

>   9. How to sort a flat text file on the 400. (McGivern, Tom)
>
>Any suggestions would be appreciated.
>
>I have a rexx script that parses some data.. And generates some output.
>This run in batch generates a qprint file.
>
>I've been doing a CPYSPLF to copy the file to a test library, and then
>download it to a unix system, where I can sort the darn thing, and
>continue with a rexx script on unix.
>
>I'd like to keep the whole thing on the 400, so I can schedule it to run
>regularly.
>
>I guess I'd like to get the data into a database file where I can then
>SELECT with an ORDER BY clause.
>
>Any suggestions on getting the following looking data into a database?
>"R12345","10/30/2003","10:20:15", etc.. (comma separated values format).
>"R12346","10/30/2003",".....

-- 
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertech.com


__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.