|
midrange-l-request@xxxxxxxxxxxx wrote: > 7. Sorting (Metz, Zak) > >I need to sort some files. The sorts are dynamic and the keying will >only be known at run-time. The files often have multi-million record >counts and an average reclen of something like 1k. Multi-million plus 1K lengths means multi-gig temp files when sorting. Ouch if space gets short. >I will be starting with a PF and need to either sort into a 2nd PF or >preferably back into the same PF. Those are requirements that I have no >control over. > >Currently this is done with FMTDTA, but we are running into the key >length limitation, and so looking for other solutions. Rather than FMTDTA where you are (apparently) generating control records into a source member, why not just build a sort control block and call the QLGSORT API? The first few times are fun, but once you have a working example, it's not bad. I have a couple CL commands... the first is a shell that builds a sort control block, using all the prompting, etc., that commands allow, and the second is a QLGSORT wrapper that uses the pre-built control block. Makes dynamic sorting in CL a breeze. A couple similar ILE RPG procedures seems ideal for you. And QLGSORT allows having the output file be the same as the input file. Tom Liotta -- -- Tom Liotta The PowerTech Group, Inc. 19426 68th Avenue South Kent, WA 98032 Phone 253-872-7788 x313 Fax 253-872-7904 http://www.powertechgroup.com __________________________________________________________________ Try AOL and get 1045 hours FREE for 45 days! http://free.aol.com/tryaolfree/index.adp?375380 Get AOL Instant Messenger 5.1 for FREE! Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
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.