BookmarkSubscribeRSS Feed
_Levi_
Calcite | Level 5

Hello,

I am working in SAS 9.4 (TS1M7) within Linux. I am trying out the TOC options with the ODS WORD statement and noticed that nothing shows up in the table besides the title "Table of Contents". I closed and re-opened the SAS session and tried a simple example but still nothing showed up. Anyone have ideas how I can get the contents to print within the Table of Contents?

 

ods word file="~/ibm/toc_text.docx" options(contents="on" toc_data="on");
title "t1";
title2 "t2";
ods proclabel="test";
proc print data=sashelp.air noobs label;
run;
ods word close;

 

2 REPLIES 2
Quentin
Super User

I found this paper by the developer of ODS Word (I think)

 

https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4265-2020.pdf

 

I ran it on 9.4M7 windows, I can see the "Table of Contents" heading and a field:  {TOC \f C \h \z}

 

If I hit Alt-F9 in Word, it will display the actual table of contents instead of the field code.

 

 

 

 

 

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
  • 2 replies
  • 758 views
  • 0 likes
  • 3 in conversation