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

Excel libname to Excel 2007

Reply
Contributor
Posts: 32

Excel libname to Excel 2007

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?
SAS Super FREQ
Posts: 8,719

Re: Excel libname to Excel 2007

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
Contributor
Posts: 32

Re: Excel libname to Excel 2007

Ah. Thanks for that.

Guess "all" we have to do, then, is the migration ;-)
SAS Super FREQ
Posts: 8,719

Re: Excel libname to Excel 2007

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]
Contributor
Posts: 32

Re: Excel libname to Excel 2007

Cheers Cynthia - will def give that a go :-)
Ask a Question
Discussion stats
  • 4 replies
  • 228 views
  • 0 likes
  • 2 in conversation