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



Assuming a convert to RPGIV, you can use my qsort utility at
www.think400.dk/downloads.htm under XVSRTQ.

Handle negatives, dates and other values correctly. Supports multiple keys.
Only kink is if you want to sort one key by ascending and another by
descending. Does not support that. Will only sort all keys ascending or
descending. No issues if you are only sorting a single key. Supports up to
16mb of data which is a lot more than can fit in a subfile.

On Wed, Jul 15, 2009 at 10:56 AM, Jon Paris <jon.paris@xxxxxxxxxxxxxx>wrote:

On 15-Jul-09, at 12:01 PM, midrange-l-request@xxxxxxxxxxxx wrote:

I have been asked to order a sub-file by a date, and plan to write
to an array instead of the

subfile record until it fills, sort the array, and then load the
subfile from this array.


1) Convert to RPG IV. Why leave it in RPG III? Any significant
compatibility issues were resolved a long time ago and it is nuts to
make updates to an RPG III program - the language has been obsolete
for 12+ years.

2) Read this article
http://www.ibmsystemsmag.com/ibmi/developer/8554p1.aspx

3) Once converted use either an Externally described DS or a DS
defined with LikeRec of the subfile output record format. Add the DIM
keyword to the DS to define it as an array.

4) Populate the subfile then add the name of the DS as the result
field on the Write to the subfile.

5) To sort the subfile you have multiple options - you can use SORTA
if you define the DS the right way - but qsort offers more flexibility.




Jon Paris

www.Partner400.com
www.SystemiDeveloper.com




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

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.