Hi SAS Masters,
I have two dataset. Have1 has 293 observations and Have2 has 246 observations. Both of them only have one variable called "base". I am wondering how many of them are shown in both datasets. I have sorted these two datasets by base. The code I used is below.
data common;
merge have1(in=h1) have2(in=h2);
by base;
if h1 and h2 then output common;
run;
however, the number of observations in "Common" is 258, which is more than the number of observations in Have2 (258 > 246). Did I use the wrong code? Thanks.