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.

 

 

 

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 934 views
  • 0 likes
  • 3 in conversation