BookmarkSubscribeRSS Feed
Calcite | Level 5

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 Tom
Super User

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.

Opal | Level 21

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;



  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.


Rhodochrosite | Level 12

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

Vince DelGobbo


Fluorite | Level 6

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.


Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 6 in conversation