×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.








Rob,

You have to access the array elements by index number, not by value.

D X               S              2S 0
C     '0204'        LOOKUP    ARN(X)                                 99
C                   IF        %FOUND
 * ... X will contain the element number in your array where '0204' was
found
 *     if you alternating table is ARA, ARA(X) is the correstonding total
pieces value.
 * ...do something with your alternating table element X
 *
                    ENDIF

Terry Richardson
Vermont Information Processing, Inc.
terry@xxxxxxxxxx


                                                                           
             simafrog                                                      
             <SimaFrog@ziplip.                                             
             com>                                                       To 
             Sent by:                  RPG programming on the AS400 /      
             rpg400-l-bounces@         iSeries <rpg400-l@xxxxxxxxxxxx>     
             midrange.com                                               cc 
                                                                           
                                                                   Subject 
             02/18/2004 03:32          Array Index Processing              
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
              RPG programming                                              
              on the AS400 /                                               
                  iSeries                                                  
             <rpg400-l@midrang                                             
                  e.com>                                                   
                                                                           
                                                                           




I built the table referred to earlier, as an alt. array. THe first part has
the year/mo and the second part has the total pieces shipped in this
year/mo. There are 60 elements to this array representing 5 years of
totals.
The index is a bit tricky for me. In order to access say April 2002, the
match would be 0204. I would want to
print for example the array name, let us call it ARN but indexed as in
ARN,0204 causes an out of bounds error.

I am obviously  missing something important but what?
Thanks,
Rob



This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.