You can use QSORT but you'd need to write a subprocedure that did a compare on
two of the array elements--its called a "call back". 
There was a recent discussion of this in the list, and I also wrote an article
on it two years ago:

http://www.mcpressonline.com/mc?1@xxxxxxxxxxxxxxxx@.6ae93a66

-Bob Cozzi
www.RPGWorld.com


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of ewart.desouza@xxxxxxxxxxx
Sent: Thursday, February 15, 2007 1:14 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Sorting an array on multiple keys using SORTA

Hi All,

I would like to sort the following array on the first 7 fields i.e. from 
WWBCD through WATNNB. Is it possible using SORTA ???  According to the 
manual you can sort only one field at a time.

     D wItmDtlDS       DS                  Inz 
     D wItmDtl                             Dim(250) 
     D  wwbcd                         3a   Overlay(wItmDtl) 
     D  wwccd                         2a   Overlay(wItmDtl:*NEXT)
     D  wjtce                         1a   Overlay(wItmDtl:*NEXT)
     D  walnb                         6s 0 Overlay(wItmDtl:*NEXT)
     D  wbdnb                         3s 0 Overlay(wItmDtl:*NEXT)
     D  waonb                         4s 0 Overlay(wItmDtl:*NEXT)
     D  watnb                         3s 0 Overlay(wItmDtl:*NEXT)
     D  wgncd                         4a   Overlay(wItmDtl:*NEXT)
     D  wexpc                         4s 2 Overlay(wItmDtl:*NEXT) 
     D  wpvat                         1a   Overlay(wItmDtl:*NEXT) 

Thanks & best regards
Ewart



This e-mail is confidential and it is intended only for the addressees. 
Any review, dissemination, distribution, or copying of this message by 
persons or entities other than the intended recipient is prohibited. If 
you have received this e-mail in error, kindly notify us immediately by 
telephone or e-mail and delete the message from your system. The sender 
does not accept liability for any errors or omissions in the contents of 
this message which may arise as a result of the e-mail transmission.

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.