Use IN=variable in MERGE statements. It is used for matched merge to track and select which observations in the data set from the merge statement will go to a new data set.
data readin;
merge file1(in=infile1) file2(in=infile2);
by id;
if infile1=infile2;
run;