红色只有两三块需要处理的话,成块转置貌似不容易。可以参考如下代码
data a;
set sashelp.class;
heightx=height*100;
weightx=height*100;
run;
data b;
set a(in=a) a(in=b);
if a=1 then do;
col1=height;
col2=weight;
output;
end;
if b=1 then do;
col1=heightx;
col2=weightx;
output;
end;
keep name sex age col:;
run;