Searching Data Structure Arrays was added in 7.1.  Are you running an earlier release?  Compiling to a previous release?
Brian May
IBM i Modernization Specialist
Profound Logic Software
http://www.profoundlogic.com
937-439-7925 Phone
877-224-7768 Toll Free
              
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dave Boettcher
Sent: Friday, May 25, 2012 3:26 PM
To: RPG programming on the IBM i / System i
Subject: Using %LOOKUP with an Array Data Structure in SQLRPGLE
Today I discovered Array Data Structures and it seemed a perfect fit for the current SQLRPGLE program. Code looks great, Verifier in RDP likes everything.
Then when I get to compiling, I get the error RNF0571 The second parameter for %LOOKUPxx is not valid.
This is the line of code (in free- format)
                      ndx = %lookup(t1.arenty :regtaxdata(*).Entity : 1 : 50);
From all I can see under %lookup in the help text / manual, the line is defined properly and it passes the verifier.
Is there some restriction on using %lookup or data structure arrays in an  SQL RPGLE program?
Or is there something else I am missing?
Data Structure Array definition is here
 *  define data structures (only used for definitions)
 d TaxInfoCalc     ds                  qualified
 d  Entity                                    like(t1.arenty)
 d  EntityName                         like(Dentyname)
 d  EntityPhone                        like(Dentyphon)
 d  EntityPhnExt                       like(DentyExt)
 d  TaxAmtPd                     11s 2
 d RegTaxData      ds                  likeds(taxinfoCalc)
 d                                      inz
 d                                     dim(50)
HTH,
TIA,
Thanks,
Whichever applies
Dave B
Sometimes I get the feeling the whole world is against me, but deep down I know that's not true.  Some of the smaller countries are neutral. -- Robert Orben (comedy writer)
As an Amazon Associate we earn from qualifying purchases.