BookmarkSubscribeRSS Feed
f_rederik
Obsidian | Level 7
With Office 2003, I can write to Excel through the SAS Excel libname engine, for example like this:

libname outxls excel 'example_out2.xls' ver=2003;

Having installed Office 2007 on a test box I have yet to succeed in creating an XLSX result file. Is this possible?
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
As this note http://support.sas.com/kb/32/455.html explains, in order to create .XLSX files with Office 2007 and the Libname engine, you must be using SAS 9.2 Phase 2.

If this is NOT the version of SAS that you are using, then the above Tech Support note explains some workarounds.

cynthia
f_rederik
Obsidian | Level 7
Ah. Thanks for that.

Guess "all" we have to do, then, is the migration 😉
Cynthia_sas
SAS Super FREQ
Hi:
One interim solution, especially if you want RESULT files or RESULT reports in Excel, would be to consider using ODS. The Output Delivery System allows you to create Microsoft Office 2003 Spreadsheet Markup Language XML files -- which supports the creation of multiple worksheets in a workbook.
There's an example of creating multiple worksheets from differing procedures at the end of this post. You will need SAS 9.0 at a minimum and Office 2002/2003. If you have Office 2007, note that Microsoft Excel 2007 will still open Office 2003 XML files.

cynthia

[pre]
ods listing close;

ods tagsets.excelxp file='c:\temp\mult_wb.xml' style=sasweb;

ods tagsets.excelxp options(sheet_name='Wombat');
proc print data=sashelp.class;
run;

ods tagsets.excelxp options(sheet_name='Shoes');
proc print data=sashelp.shoes(obs=25);
run;

ods tagsets.excelxp options(sheet_name='Regions');
proc freq data=sashelp.shoes;
tables region;
run;
ods tagsets.excelxp close;
[/pre]
f_rederik
Obsidian | Level 7
Cheers Cynthia - will def give that a go 🙂

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
  • 4 replies
  • 943 views
  • 0 likes
  • 2 in conversation