You've gotta have the DIM keyword on the prototype. LikeDS retrieves the
structure of the DS but not the DIM keyword.
HTH,
Brian May
Project Lead
Management Information Systems
Garan, Incorporated
Starkville, Mississippi
Young i Professionals
http://www.youngiprofessionals.com
Bryce Martin <BMartin@xxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
08/03/2009 02:00 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
rpg400-l@xxxxxxxxxxxx
cc
Subject
Passing Datastructure Array
Ok, I've tried google, I've searched the archives and checked other lists.
And what seems like it should work, doesn't. So I turn to you RPGLE
wizards...
The Problem... I'm trying to pass a datastructure array to a subprocedure
to do a "%lookup" since %lookup doesn't support qualified names. The
problem is that I'm getting a compile error that says "RNF0528 Index is
not allowed for name that is not an array; index is ignored." It is
basically saying that the array in my PI isn't an array...
The Code...
D FindFSOds...
D PR 2s 0
D EntryDS LikeDS(sqlDS)
D ShopOrder...
D 6s 0
D
D sqlDS ds qualified Dim(20)
D Shop_Order...
D 6s 0
D Parent_SO...
D 6s 0
P FindFSOds...
P b
D FindFSOds...
D PI 2s 0
D EntryDS LikeDS(sqlDS)
D ShopOrder...
D 6s 0
D
D
D ArraySize...
D c Const(20)
D rtrnIdx...
D s 2s 0
D x...
D s 2s 0
/free
rtrnIdx = 0;
for x = 1 to ArraySize;
if EntryDS(x).Shop_Order = ShopOrder;
rtrnIdx = x;
leave;
endif;
endfor;
return rtrnIdx;
/end-free
P FindFSOds...
P e
******************************************************************end of
code
The compiler error points to the "if" statement and says that the EntryDS
can' have (x) because its not an array. Doesn't the like DS mean that it
is? And that it will automatically be qualified?
I'm confused. What am I missing?
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
--- This message (including any attachments) is intended only for the use
of the individual or entity to which it is addressed and may contain
information that is non-public, proprietary, privileged, confidential, and
exempt from disclosure under applicable law. If you are not the intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited. If
you have received this communication in error, please notify us and
destroy this message immediately. ---
As an Amazon Associate we earn from qualifying purchases.