proc sql;
select a.name as name
from (select name from dictionary.columns where libname = "WORK" and memname = "DATA1") a,
(select name from dictionary.columns where libname = "WORK" and memname = "DATA2") b,
(select name from dictionary.columns where libname = "WORK" and memname = "DATA3") c
where a.name = b.name and b.name = c.name;
quit;
proc sql;
create table common_var as
select distinct name, memname
from dictionary.columns
where libname="SASHELP" /*and upcase(memname) in (your-dataset-list-of-interest)*/
group by name
having count(distinct memname)>1;
quit;
你可以在ihust的程序里把名字都变成大写:
proc sql;
create table out as
select name
from out1
where (upcase(name) in (select upcase(name) from out2)) and (upcase(name) in (select upcase(name) from out3))
;
run;