BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hetuvio
Calcite | Level 5

Hello,

In SAS V9.1.3, the code below allows us to insert a toc field in the RTF file (thanks to the ods proclabel statement). Then we compile together each RTF files into a single RTF document, and it was then easy to generate to ToC of the document.

I would have expected that it will continue to work in SAS V9.4, but - unless I'm wrong, it seems to do not work anymore. Could you please let me know how to solve it ?

ods rtf file = "C:\Users\test.rtf" ;

report data = sashelp.stocks headline headskip nowindows list split='£' formchar(2) ='_' missing spacing=1 style={rules=groups frame=hsides} contents="" ;

title1 " ";

ods proclabel="Titre table";

column ("Titre table" date open) ;

where stock='IBM' ;

run ;

rtf close ;

Thanks in advance for your help,

BR,

Violaine

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Some of your code got eaten by the paste into the this forum. You may want to edit the post to include the missing bits.

Please describe how "it seems not to work". No RTF file generated? No TOC bits in the parts of the document? Missing when the document is combined?

Have you tried explicitly adding a toc_data option on the rtf statement? It looks like from the documentation that the default is NOTOC_data.

View solution in original post

3 REPLIES 3
ballardw
Super User

Some of your code got eaten by the paste into the this forum. You may want to edit the post to include the missing bits.

Please describe how "it seems not to work". No RTF file generated? No TOC bits in the parts of the document? Missing when the document is combined?

Have you tried explicitly adding a toc_data option on the rtf statement? It looks like from the documentation that the default is NOTOC_data.

Cynthia_sas
Diamond | Level 26

Hi:

  BallardW is correct -- in earlier versions of SAS, you only needed to code CONTENTS=YES for ODS RTF. BUT, in SAS 9.4,  you also need to code TOC_DATA -- that happened between SAS 9.2 and 9.3, I believe.

cynthia

hetuvio
Calcite | Level 5

Thank you! The issue is solved.
BR,

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2032 views
  • 3 likes
  • 3 in conversation