BookmarkSubscribeRSS Feed
Florent
Quartz | Level 8
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.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 1 reply
  • 1141 views
  • 0 likes
  • 2 in conversation