|
If you don't want to use QSort, you might want to wait for V5R3. The problem with that technique is that is sorts all 5000 elements regardless of how many are actually in the array at the time. So you could potential end up with a bunch of crap at the start of the array. I wrote an article on using QSORT to sort data structures (and showed how to apply that to a subfile) in my free news letter. Go to www.mcpressonline.com/midrangedev and click on the article that contains the phrase "Subfile sort". Bob Cozzi -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan E. Sent: Saturday, January 17, 2004 8:56 AM To: RPG programming on the AS400 / iSeries Subject: Re: Sort of a Data Structure Array... Idea Booth's idea is ingenious, here's another. You could keep your data structure is it is, then initialize a pointer to it, and then base the array on that pointer. You could also define another based-pointer array with ASCEND, to handle that. (Added code is in-line) ----- Original Message ----- From: <CarollaT@xxxxxxxxxxxxxx> | | D DispItems DS Qualified Dim(5000) | D Insurance 5S 0 Inz(0) | D Family 9P 0 Inz(0) | D Member 2S 0 Inz(0) | D Claim 4P 0 Inz(0) | D Assigned D Inz(*Loval) ==> D p_DispItems S * inz( %addr( DispItems ) | D DispArray S 25A Dim(5000) DESCEND ===> Based( p_DispItems ) - Alan _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.