|
I've searched the archives and can't find an answer on this. How do you do
a Lookup in a multiple-occurrence data structure. This is my first one and
I can't seem to find a (good) solution.
Here's my DS:
D Record ds occurs(2000)
D Comp# 4 0
D Prod# 7 0
D CurDat 8 0
D CurPrc 7 4
D Status 1
D GL# 7 0
I am populating this with an SQL cursor loop, and doing Order By the last
field, GL#. Now I need to be able to do some kind of lookup on the GL#
field and return the element number that gets the hit.
I know I can do something funky, like do a loop that checks each occurrence
of the GL# field, or pull the GL# field out of the DS and make it its own
array (both ugly), but isn't there a built-in function for this? I tried
%lookup but that doesn't compile if it's not an array.
Help? (TIA.)
--
This is the RPG programming on the IBM i / System i (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.
As an Amazon Associate we earn from qualifying purchases.
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.