There are many ways to read ODS output with Microsoft Excel, Word and PowerPoint.
Beginning with SAS 9.1, you can use the TAGSETS.EXCELXP destination to generate XML output, which can be imported into a spreadsheet. This format allows you to generate multiple worksheets per workbook. This format does not currently support images, unike the MSOffice2K destination. When generating output from procedures, this is one of the best methods of keeping the table in the current format. Here is an example:
ods Tagsets.ExcelxP body='temp.xml'; proc print data=sashelp.class; run; proc print data=sashelp.class; run; ods Tagsets.ExcelxP close;
Excel can read HTML files which can be created from the ODS MSOffice2K destination beginning with SAS 9. When generating HTML in SAS 9 and later releases, the MSOFFICE2K destination is the preferable method of generating HTML which is read by Excel. Prior to SAS 9, the ODS HTML destination is the preferable method of generating HTML that can be read with Excel.
ods MSOffice2K body='temp.xls'; proc print data=sashelp.class; run; proc print data=sashelp.class; run; ods MSOffice2K close;
Excel can read files with comma-separated values (CSV). You can use the ODS CSV destination to generate CSV output from SAS procedures. To include the titles and footnotes, use the ODS CSVALL destination. Specifying ODS CSV destination yields the data without titles.
ods csv file='temp.csv'; proc print data=sashelp.class; run; ods csv close;
proc export data= work.test outfile= "C:\temp.csv" dbms=csv replace; run;
Dynamic Data Exchange (DDE) can write directly to an Excel file.
ODS RTF output can be imported into MS Word. With SAS 9.2, you can also use the ODS TAGSETS.RTF destination.
ods rtf file='temp.rtf'; proc print data=sashelp.class; run; ods rtf close;
In PowerPoint, you can use text created in other programs to make a new presentation or add slides to an existing presentation. Prior to the Office 2000 release of PowerPoint, the text you import is in outline format. PowerPoint takes the outline structure from the styles in the imported document. A Heading 1 becomes a slide title, a Heading 2 becomes the first level of text, and so on. If the document contains no styles, PowerPoint uses the paragraph indentations to create an outline structure.
With the Office 2000 release, this does not appear to be the case. When an RTF file is opened in PowerPoint, it is in table format instead of the outline format. Here is an example of using ODS RTF to generate a text file that you can use in PowerPoint:
ods rtf file='temp.rtf'; proc print data=sashelp.class; run; ods rtf close;
The following two solutions work well with the Office 97 release of PowerPoint:
Also see the full PROC TEMPLATE FAQ and Concepts.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | All | n/a |
Type: | Usage Note |
Priority: | low |
Topic: | Data Management ==> Data Sources ==> External Databases ==> MS Excel SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> RTF Third Party ==> Output ==> HTML Third Party ==> Products ==> Microsoft Office |
Date Modified: | 2005-07-11 18:34:56 |
Date Created: | 2004-01-20 16:43:15 |