proc import out=test
file='C:\Users\Administrator\Desktop\CEO任期.xls' replace;
run;
data want;
set test(rename=(year=tmp_year CEOtenure=tmp_CEOtenure) obs=100);
tmp_int=int(tmp_CEOtenure);
if tmp_int<1 then output;
else
do tmp_i=1 to tmp_int+1;
CEOtenure=ifn(tmp_i<tmp_CEOtenure,tmp_i,tmp_CEOtenure);
year=tmp_year-tmp_int+tmp_i-1;
output;
end;
drop tmp:;
run;
proc print;run;