I have two datasets. Dataset A has Account IDs and Balance. Dataset B has Accounts IDs and other variables. Account IDs in dataset B are duplicated. data a;
input acct_id Bal$
21 111
20 222
24 213
26 290
29 300
data b;
input acct_id y$
21 a
21 b
21 c
21 d
21 e
I want to merge these datasets so that i get the following dataset
21 a 111
21 b 111
21 c 111
21 d 111
21 d 111
21 e 111 I tried the following patch data c
merge b(in=inb) a;
by acct_id;
if inb;
run; But the results are not what i expected. The final dataset has almost double the observations than the b dataset. I'm not sure why that might be happening. What am i doing wrong?
... View more