SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Creation of a multi-sheets Excel file with SAS 8.2

Reply
Frequent Contributor
Posts: 127

Creation of a multi-sheets Excel file with SAS 8.2

Dear all,

Would anyone know how to easily generate a multi-sheets Excel file from multiple datasets by using SAS 8.2 ? One dataset corresponding to one worksheet in Excel. It should act as the SHEET option of the PROC EXPORT on SAS 9.

In addition I'd like to find a solution which does not require Excel to be opened and the Excel File to exist before executing the SAS code.

I've already read a lot of topics on the internet but none gave me the expected results.

Thank you in advance for helping me out.

Kind regards,
Florent.
SAS Super FREQ
Posts: 8,719

Re: Creation of a multi-sheets Excel file with SAS 8.2

Florent:
In SAS 8.2, you only have ODS HTML available to you. By default, ODS HTML will create one worksheet for EVERY ODS sandwich:
[pre]
ods html file='allinone.html' style=sasweb;
proc print data=file1; run;

proc print data=file2; run;

proc print data=file3; run;
ods html close;
[/pre]

However, using Microsoft's design for linking separate HTML files together, you can make one workbook that uses each HTML file for a separate worksheet., as described in these previous forum postings (sorry, I don't know how "easy" this is -- but I have made it work):
http://support.sas.com/forums/thread.jspa?messageID=18828䦌
http://support.sas.com/forums/thread.jspa?messageID=8132ῄ
http://support.sas.com/forums/thread.jspa?messageID=12780㇬ (#2 item)

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 183 views
  • 0 likes
  • 2 in conversation