Hi:
The code at the bottom of this posting worked for me in EG 4.2 in a code node. Note that the OUTFILE= name stays the same and the DATA= and SHEET= values differ for each of my datasets.
Using this code, the first dataset goes into sheet1, the second into sheet2, the third into sheet3 (each named as specified). Without seeing ALL of your code, it is hard to figure out what the issue might be. Were you by any chance using a macro program to iterate through a list of datasets???
Note that I use the DBMS= value for Excel 2002 -- this is to ensure that Excel creates an Excel97-2003 compliant XLS file -- and avoids any .XLSX issues if you do not have SAS 9.2 Phase 2.
As described here:
http://support.sas.com/kb/32/455.html
cynthia
[pre]
** Proc Export method to create multiple sheets;
proc sort data=sashelp.shoes out=Pshoes;
where region = 'Pacific';
by region subsidiary;
run;
proc sort data=sashelp.shoes out=WEshoes;
where region = 'Western Europe';
by region subsidiary;
run;
proc sort data=sashelp.shoes out=Drshoes;
where product contains 'Dress';
by region subsidiary;
run;
proc export data=Pshoes
outfile= "c:\temp\exp_method.xls"
dbms=excel2002 replace;
sheet="Pacific";
run;
proc export data=WEshoes
outfile= "c:\temp\exp_method.xls"
dbms=excel2002 replace;
sheet="West_Eur";
run;
proc export data=DRshoes
outfile= "c:\temp\exp_method.xls"
dbms=excel2002 replace;
sheet="Dressy";
run;
[/pre]