Exporting Multiple Data Sets to One Spreadsheet

/ Published in: SAS
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. /*Each data set will be in a separate worksheet:*/
  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;
  19. /*Results.xls will have three worksheets, each one automatically labeled with the name of the data set it was created from.*/

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

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.