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

Creation of a multi-sheets Excel file with SAS 8.2

Frequent Contributor
Posts: 129

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,
Posts: 9,038

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

In SAS 8.2, you only have ODS HTML available to you. By default, ODS HTML will create one worksheet for EVERY ODS sandwich:
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;

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):䦌ῄ㇬ (#2 item)

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation