OK Pedro.
Not knowing the particular details of your process, I would say, and if and only if, you are dealing with a small dataset vs huge dataset, format match will probably give you the best result, and without the need of a complex coding.
Basically, I'm suggesting loading the small dataset into a format and perform a single passage through the huge dataset matching the key with the format and outputting to a third dataset if the match is successful.
Technically, the basis of this technique is similar to hashing, it involves a single passage to one of the table while the other resides in memory.
But, although Hashing with duplicate keys is natively supported with SAS 9.2, the implementation is also possible in 9.1, through the Hash iterator and/or using multiple Hash objects.
Index match will also be possible, but I'm not talking about using an index on the large table, instead I would use an index in the smaller table. And yes, there is actually a technique that permits index merge with n-to-n tables (by purposely failing the match to reset the index).
But no need here for neither of them, I think good old format match will suffice.
If you would care about considering this approach, I'm sure you have there some good fellows who could help you with the concepts of format match.
😄
Cheers from Portugal
Daniel Santos @
www.cgd.pt