data a;
input company year price;
datalines;
1 1 3
1 2 5
2 1 2
2 2 3
3 1 3
3 2 7
;
data b;
input company;
datalines;
2
3
;
proc sql;
create table abcom AS
select *
from a
where company in (select company from b)
;
quit;
proc print noobs; run;
SAS Output:
company year price
2 1 2
2 2 3
3 1 3
3 2 7
Or use sql like:
***********************
proc sql;
create table abcom AS
select * from a,b
where a.company=b.company;
;
quit;
*or;
proc sql;
create table abcom AS
select a.company,a.year,a.price from a,b
where a.company=b.company;
;
quit
*Or;
proc sql;
create table abcom AS
select a.company,a.year,a.price from a inner join b
on a.company=b.company;
;
quit;


雷达卡




京公网安备 11010802022788号







