soporaeternus 发表于 2011-11-16 14:57 
我是纯粹来搞笑的......
一般还是
列传行保留列名-〉连接-〉行转列 比较靠谱,呵呵
Why not use a <case when end> recode statement in SQL?
data t1;
a=1;b=2;c=3;d=4;att1='a';att2='c';
run;
proc sql;
select
case att1
when 'a' then a
when 'b' then b
when 'c' then c
else d
end as att1v,
case att2
when 'a' then a
when 'b' then b
when 'c' then c
else d
end as att1v
from t1
;
quit;