Use DICTIONARY.COLUMNS (SQL) or SASHELP.VCOLUMN (data step) to compare the variables in both datasets.
e.g.
data check;
merge
sashelp.vcolumn (in=d1 where=(libname="LIB1" and memname="DS1"))
sashelp.vcolumn (in=d2 where=(libname="LIB2" and memname="DS2"))
;
by name;
if d1 and d2 then check = "both";
else if d1 then check = "d1";
else check = "d2";
keep name check;
run;
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!