proc transpose data=s_list out=list(drop=_NAME_);
by type;
run;
2.俩表连一块儿 (其实还是用natural left join 比较好)
proc sql;
create table mergedata as
select provid, code, type
from drug left join list
on list.col1=drug.code;
quit;
run;
3.新建三列判断type
data final;
set mergedata;
if type='a' then do;
type_a=1;
type_b=0;
type_c=0;
end;
else if type='b' then do;
type_a=0;
type_b=1;
type_c=0;
end;
else if type='c' then do;
type_a=0;
type_b=0;
type_c=1;
end;
else do;
type_a=0;
type_b=0;
type_c=0;
end;
run;
不知道是不是你想要的哈