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



Kevin,

Either use QSORT, like Scott and Bob suggested, or do it like this:

D                 DS
D Order1                              Dim(99)
D   DtlItem                     12A   Overlay(Order1:*NEXT)
Inz('999999999999')
D   DtlOrdQty                    5S 0 Overlay(Order1:*NEXT) Inz(99999)

This way you lose the qualification, i.e. in stead of using
Order1(x).DtlItem you will have to use DtlItem(x), but you can sort the
orders. You can sort Order1, DtlItem or DtlOrdQty (when you sort a subfield
of an array, the whole array is sorted in that order).

Joep Beckeringh


----- Original Message -----
From: <keblake@xxxxxxxxxxxxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Tuesday, December 09, 2003 12:20 AM
Subject: SORTA and Data Structure Arrays


> I have an array defined as follows:
>  D Order1          DS                  Dim(99)
>  D                                     Qualified
>  D DtlItem                       12A   Inz('999999999999')
>  D DtlOrdQty                      5S 0 Inz(99999)
>
> After loading the Array I try to sort the array:
> C                   SortA     Order1
>
> and I recieve the following compilation error:
> RNF5159: Factor 2 operand must be an array name for specified operation.
>
> I have a feeling I am missing something obvious here.
> Would someone be kind enough  point it out to me?
>
> thanks,
>
> Kevin E. Blake
> Highlights For Children
> I.S. Sr. Staff Specialist
> 614-487-2706
>
>
> _______________________________________________
> 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 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.