The SAS Output Delivery System and reporting techniques

ODS directly to Word

Reply
N/A
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?

Thanks.

Super User
Super User
Posts: 7,055

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.

PROC Star
Posts: 7,474

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 http://support.sas.com/resources/papers/proceedings11/250-2011.pdf ):

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

options(doc="help"

sect="none"

trhdr="\trrh800"

trowhdrcell="\cltxbtlr");

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

run;

ods tagsets.rtf close;

SAS Super FREQ
Posts: 8,866

Re: ODS directly to Word

Hi:

  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.

cynthia

SAS Super FREQ
Posts: 304

Re: ODS directly to Word

Posted in reply to Cynthia_sas

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

http://www.sas.com/technologies/bi/office-analytics.html

http://blogs.sas.com/content/sastraining/2012/03/19/sas-office-analytics-my-own-personal-easy-button...

Vince DelGobbo

SAS R&D

Contributor
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
  • 3272 views
  • 0 likes
  • 6 in conversation