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



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.

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.