|
Doesn't SORTA sort the entire array by default as if it only had one field? I don't think there is a way to tell it to sort your array on a field lower down in the structure. say field wathb. If you want to sort on that field as the high order it needs to be the first field in the array. When I want to sort an array multiple ways I usually have the first field named "Sortfield" or something similiar and set the value of this to the field I want to sort on. ________________________________ From: rpg400-l-bounces@xxxxxxxxxxxx on behalf of rob@xxxxxxxxx Sent: Thu 2/15/2007 8:52 AM To: RPG programming on the AS400 / iSeries Subject: Re: Sorting an array on multiple keys using SORTA Originally I was going to suggest overlaying the first 7 fields with one big field. Then I thought, why not sort the whole thing? Would you NOT want to sort the last remaining fields, like, does it cause a problem? So why not just sort wItmDtl? Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com <http://www.dekko.com/> ewart.desouza@xxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/15/2007 04:18 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To <rpg400-l@xxxxxxxxxxxx> cc Fax to 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. -- 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. -- 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.