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



DS Arrays only support the use of the "vanilla" form of %Lookup. Not the GE etc. versions.

You could code it this way:

d baseDS ds
d SearchArr Dim(5000) ASCEND
d $SearchStrg 16a Overlay($SearchStrg)
d $cust_id 9b 0 Overlay($SearchStrg: *Next)

That will support the GE version.

You do know that using the B data type is a really really bad idea right? Why not make it 10i ?


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Apr 18, 2017, at 11:41 AM, Gerald Magnuson <gmagqcy.midrange@xxxxxxxxx> wrote:

I have tried both of your examples, and I get a RNF3701 (the qualified
keyword is not allowed for a subfield definition)...

I just can't find the correct combination.....


On Tue, Apr 18, 2017 at 9:39 AM, Paul Therrien <
paultherrien@xxxxxxxxxxxxxxxxxx> wrote:

I think that your statement should work:

foundElem = %lookupGE('A':SearchArr(*).$SearchStrg);


You may need to specify that the array is in ascending sequence

d SearchArr ds Dim(5000) qualified ASCEND
d $SearchStrg 16a
d $cust_id 9b 0


Incidentally, I see in the manual the example that you used for your
original array/ds specification.

The overlay keyword would work if you specified SearchArr as an element of
the data structure and not the name of the data structure.

d ds

d SearchArr 50 a Dim(5000) qualified ASCEND

d $SearchStrg 16a overlay(SearchArr)

d $cust_id 9b 0 overlay(SearchArr:*NEXT)


Paul




On 2017-04-18 10:26, Gerald Magnuson wrote:

thanks Paul,
the load and the sort works fine but
what should the %lookupGE command look like?

On Tue, Apr 18, 2017 at 9:13 AM, Paul Therrien <
paultherrien@xxxxxxxxxxxxxxxxxx> wrote:

I don't think you want to use the overlay keywords as you are doing.
You are telling the compile that $SearchStrg overlays the array.

Try this:

d SearchArr ds Dim(5000) qualified
d $SearchStrg 16a
d $cust_id 9b 0

Paul

On 2017-04-18 09:45, Gerald Magnuson wrote:

I have a 2d array, which contains a search key and option id:
d SearchArr ds Dim(5000) qualified
d $SearchStrg 16a overlay(SearchArr)
d $cust_id 9b 0 overlay(SearchArr:*NEXT)

I load up the array, then do:
Sorta SearchArr(*).$searchStrg ;

but the compiler is telling me I can't do:
foundElem = %lookupGE('A':SearchArr(*));
because "the Data structure Array SearchArr must be specified in the form
DS_ARRAY(*).KEY_SUBF"

so I try:

foundElem = %lookupGE('A':SearchArr(*).$SearchStrg);

and the compiler tells me "$SearchStrg is not an array"

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


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.