Hey there,
I recently discovered that it is possible to create a contents page for my RTF files (and they need to be in RTF) using the below options
ods rtf file="C:\dir\reports.rtf" contents=yes toc_data ;
The issue I have is that I would need to manually open each RTF document, right click and select 'Update Field' to generate a table of contents. This has two major issues:
(1) It alters the modification date because the document would need to be saved
(2) It can be very time consuming if there are many outputs
Is there a way to ensure that SAS automatically adds the contents page to an output without the need to open the document and manually create the table of contents though the 'Update Field' setting?
Your help on this would be most appreciated. If this is not possible at all then this would prevent many headaches 🙂
You can find some helpful tips here for creating your SAS output https://www.sas.com/content/dam/SAS/support/en/books/ods-techniques-tips-for-enhancing-your-sas-outp...
Hi:
Although Kevin's book is excellent, it's probably not going to answer your Table of Contents question. As far as I know, in an RTF document, when it is opened in Word, if the RTF document has the TOC field codes, you have to click to Update Fields. I don't know of any way around that except for some kind of Word/VB automation and then you are going to run into the same problem of the document date and probably the format changing (from RTF to .doc or .docx).
And I just tested with ODS WORD in 9.4M6 (preproduction destination) and I still had to do Update Field to make the TOC visible. You might want to open a track with Tech Support to find out whether there's going to be a way to NOT have to update field when the destination is production.
Cynthia
Hi Cynthia and Mark,
An RTF table made outside of MS Word was meant to be used as an in-text table in a report. In the old days, Word let you make a link to the file and every time we updated the table we told the medical writer, and every time the writer opens the report, all the links would be updated, including the titles. So you can't avoid the date change of the report, but you can fix the production date of the table. If you have a few rtf tables as a standalone report, I think SAS can add or you can figure it out an option to generate a cover page like the one below, which clearly let you know where to click, or you send the report to your client and let them to click.
Best Regards,
Jianmin Long
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.