BookmarkSubscribeRSS Feed
Mark_lmnt
Fluorite | Level 6

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 🙂

 

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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

Jianmin
Obsidian | Level 7

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

Jianmin_0-1589685068421.png

 

 

 

Mark_lmnt
Fluorite | Level 6
Thanks for getting back to me and also providing ODD tips links. I will take your advice and attempt to find a way of getting around this. Thanks again 🙂

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 986 views
  • 3 likes
  • 4 in conversation