Posted By

webonomic on 03/19/11


Tagged

excel export dataset spreadsheet worksheet


Versions (?)

Exporting Multiple Data Sets to One Spreadsheet


 / Published in: SAS
 

URL: http://www.lindasas.blogspot.com/

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).

  1. /*Each data set will be in a separate worksheet:*/
  2.  
  3. proc export
  4. data=work.region
  5. outfile="c:\temp\results.xls"
  6. dbms=Excel;
  7. run;
  8. proc export
  9. data=work.county
  10. outfile="c:\temp\results.xls"
  11. dbms=Excel;
  12. run;
  13. proc export
  14. data=work.district
  15. outfile="c:\temp\results.xls"
  16. dbms=Excel;
  17. run;
  18.  
  19. /*Results.xls will have three worksheets, each one automatically labeled with the name of the data set it was created from.*/

Report this snippet  

You need to login to post a comment.