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.) 
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 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.