I have a number of SAS programs that produce outputs (e.g. table1_1.SAS, Table2_1.SAS etc) using proc report that produce their respective tables (Table 1.1.RTF and Table 2.1.RTF etc.).
I am trying to merge all outputs (so multiple files produced) into one RTF file and have Microsoft word create a table of contents based on headers.
I've found an old paper on adding MS Word Headers into ODS RTF outputs that is based on SAS 8.2+. I'm sure it would work on the modern SAS 9, but I am wondering if there are more modern approaches.
I'll explore ods word, but however, each code produce its independent table.
BUt yeah, the process I am thinking about is via VBA after adding headers via SAS
log and lst files needs to be saved for each respective program. so the include statement doesn't fully work because of that as I recall.
Hi @Tpham ,
The paper you cited is a privative way to answer your request, as @Reeza outlined in this response. You will also have to figure out a way for a cover page or top page to make the TOC visible, something like this:
this is for a large file with many sections which needs a TOC for each section title/header. See this file This is way beyond what SAS ODS RTF REPORT/DOCUMENT is currently doing. Another example for multiple listings/tables with a TOC.
Many Thanks
Jianmin Long
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.