Hi.
I'm sorry, but still I'm not quite sure about what you are trying to do.
From your example and looking at your code, it seems to me you are trying to do a N-to-N match by KEY_ID using, is this correct?
If so, N-to-N match is not feasible through MERGE (at least, in a easy way), but you can achieve that with a simple SQL inner join, like this:
[pre]
proc sql noprint;
create table RESULT as
select a.KEY_ID, a.AMT, b.OBLGID
from PAYMENTS as a inner join PAID_ITEMS as b on a.KEY_ID = b.KEY_ID;
quit;
[/pre]
Cheers from Portugal
Daniel Santos @ www.cgd.pt
... View more