waitalone11 发表于 2010-1-28 23:37 
好 谢谢啊 如果我用proc export能实现吗?
Here is the one with proc export;
data t1;
do i =1 to 5;
sex='F';
age=i*10;
output;
end;
do i =1 to 3;
sex='M';
age=i*10;
output;
end;
run;
PROC EXPORT DATA = t1(where=(sex='F'))
OUTFILE = "c:\downloads\test.xls" dbms=excel2000 REPLACE;
sheet='F';
RUN;
PROC EXPORT DATA = t1(where=(sex='M'))
OUTFILE = "c:\downloads\test.xls" dbms=excel2000 REPLACE;
sheet='M';
RUN;