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
SAS Super FREQ
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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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