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




On 10/01/2008, at 6:55 AM, Coyle, Stephen F. wrote:

If I have a data structure coded as below, how can I do a lookup against
a subfield?
I1$IIT is a subfield of the IIT field. I'd like to find the element that
matches I1$IIT.

The compiler didn't like mine:
nWrkIIT = %Lookup( xIIT:a57832.IIT.I1$IIT:1:nIIT ) ;

D a57832 DS QUALIFIED DIM(20)
D IIT LikeRec(I57832)
D PMcu Like( KgMcu )
D PSub Like( KgSub )
D PObj Like( KgObj )
D OANI Like( GlAni )
D OAA Like( GlAA )

Or is this data structure not defined correctly?

You should get two compiler errors with this code:
1) Operand for a qualified name expression is not valid
2) Second parameter for %LOOOKUP not valid

1) is caused by a57832 being an ARRAY DS but you haven't specified an array element.

2) is caused by %LOOKUP expecting an array as the FINAL field

ITT is not itself an array. It is an element of the a57382 array.

So you should now see how to solve this problem. You need to ensure that IIT is actually an array either by defining it as an array or making it overlay an array.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.