Monday, October 23, 2006

Exporting Multiple Data Sets to One Spreadsheet

It's easy to export several data sets to one Excel spreadsheet with each data set in a separate worksheet.This example exports three SAS data sets (work.region, work.county and work.district) to the same spreadsheet (results.xls).

Each data set will be in a separate worksheet:

proc export
data=work.region
outfile="c:\temp\results.xls"
dbms=Excel;
run;
proc export
data=work.county
outfile="c:\temp\results.xls"
dbms=Excel;
run;
proc export
data=work.district
outfile="c:\temp\results.xls"
dbms=Excel;
run;

Results.xls will have three worksheets, each one automatically labeled with the name of the data set it was created from.

2 Comments:

At 2:01 PM, Anonymous Anonymous said...

Linda look into using the Excel Libname Engine in SAS V9, the process becomes even easier and faster.

 
At 12:05 AM, Blogger Pavan Kumar Jupelli said...

1.like this, can i import multiple excel sheets from an excel file into multiple sas datasets?

2.multiple excel sheets from an excel file into a single sas dataset?

 

Post a Comment

<< Home