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



I ended up creating 2 arrays like you suggested. I thought I could get
it to work the way I had it but I've got to move on.

Thanks Alan and Joe...

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Wednesday, January 09, 2008 3:50 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Data Structure Array Lookups

From: Coyle, Stephen F.

"The second parameter for %LOOKUPxx is not valid."
I must have the DS defined wrong for what I want to do. The subfields
are not recognized as arrays.

I haven't tried it, Steve, but I don't think it will work the way you
want.
Every example I've seen of this type of thing uses OVERLAY(*NEXT) and a
DIM
on each subfield. I think you might have to put an extra field in your
data
structure that is defined like I1$ITT, and then remember to populate
that
field when you populate the record. Then you can sort or lookup on that
field.

But if you're not sorting, you're making a lot of extra work for
yourself.
Just create two arrays, one with the data and one with the keys. Do the
lookup on the key array and use the index for the data array!

Joe


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.