The SAS Output Delivery System and reporting techniques

ODS directly to Word

Posts: 1

ODS directly to Word

I was asked by my superior (a non-SAS user) about the existence of SAS add-on that allows a programmer to directly output SAS results in a word document. I know ODS can output to spreadsheets, pdfs, and rtfs, but I've never heard of any code, product, or add-on that allows output to be directly written to a docx. Does such a thing even exist?


Super User
Super User
Posts: 6,499

Re: ODS directly to Word

There is a SAS add-on to Microsoft Office that allows you to embed inside of Word logic that can connect to SAS server and run stored processes so that results are returned inside word.  

Otherwise you are correct. If you produce output from SAS program it will need to be converted by Word.  RTF is the normal format for producing output that Word can read.  You can produce RTF format using ODS RTF statements.

Posts: 7,360

Re: ODS directly to Word

Not quite the same but you can always create an rtf file and simply make the extension docx.

e.g. (from Chevell Parker's paper ):

ods tagsets.rtf file="c:\temp.docx"





proc print data=sashelp.class style(obsheader header)={just=l};


ods tagsets.rtf close;

Posts: 8,742

Re: ODS directly to Word


  Also, the SAS Add-in for Microsoft Office (part of the SAS Platform for Business Analytics) does allow you to run regular tasks and wizards against your data (described in the metadata) and then get the results returned to you to Word, Excel, PowerPoint or Outlook - -this means that you would be already inside a .DOCX, .XLSX, .PPTX, etc file when the results came back to you. You would only use ODS if you running a stored process and returning the results to the client application (the SAS Add-in for Microsoft Office application).

   But, with a Base SAS installation, creating ODS RTF files is generally an accepted way to create output for Microsoft Word.


SAS Employee
Posts: 284

Re: ODS directly to Word

The SAS Add-in for Microsoft Office that Cynthia mentioned is also available as part of the SAS Office Analytics package:

Vince DelGobbo


Posts: 41

Re: ODS directly to Word

Actually, it depends on what type of results you need to embed in word.

We use this logic in a company: by using COM interface we connect to SAS from Word's VBA and run necessary code to produce data (in csv, xls or whatever) in a certain location.

Then this data is imported to word/excel using vba, and creating of all required objects is performed.

Last - you just (also with VBA) insert all results which are already in MS native formats to a certain place in a Word document template.

Kind of messy from the first glance... but we don't have SAS BI since it costs 'like an airplane wing'. Moreover, once implemented it's quite easy to use.

Ask a Question
Discussion stats
  • 5 replies
  • 6 in conversation