Sunday, February 27, 2011

Writing Excel files out from SAS

It is very easy to write out an Excel file using proc export in SAS version 8. Consider the following sample data file below.

Obs    MAKE               MPG          WEIGHT           PRICE
1 AMC 22 2930 4099
2 AMC 17 3350 4749
3 AMC 22 2640 3799
4 Buick 20 3250 4816
5 Buick 15 4080 7827

Here is a sample program that writes out an Excel file called mydata.xls into the directory "c:\sasdata".

proc export data=mydata
outfile='c:\dissertation\mydata.xls' replace;
run;

No comments:

Post a Comment