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

Hi!

I am trying to generate a sheet with a table of contents with my ods excel statement. I am not quite sure of how this works but I'm hoping that it will take the titles and title2:s and display them on a separate sheet. However, no table of contents appears in my Excel file.

 

I have several proc reports in my program. Is there anyone out there who knows what I am doing wrong or if there is something in my SAS installation that is missing?

 

I use SAS Enterprise Guide version 7.15.

 

ods excel file="&ROOTDIR.\&FILENAME...xlsx";
ods excel options(embedded_titles='YES' sheet_interval='proc' autofilter='all' contents='yes' );

ods excel options(sheet_name='TABLE1');
title "...";
title2 "...";

proc report;
etc etc...
run;

ods excel close;
1 ACCEPTED SOLUTION

Accepted Solutions
vanja
Obsidian | Level 7

Thank you for trying to help me! ODS PROCLABEL alone didn't do the trick. By examining the code to the case you referred to I realized that instead of dividing the "ods excel file" and "ods excel options" into two lines of code and put it on the same line I actually got a Table of Contents. It is not very pretty and I get some lines in my table of contents that I would rather not have;

"Report"

"Table 1"

 

But still, good progress!

 

ods excel file="&ROOTDIR.&FILENAME..xlsx"
          options(embedded_titles='YES' contents='yes' autofilter='on' sheet_interval='proc');

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Going to guess that your missing ods proclabel per this from a quick use of the search bar!

https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-Visible-TOC-Levels-in-Files-Create...

vanja
Obsidian | Level 7

Thank you for trying to help me! ODS PROCLABEL alone didn't do the trick. By examining the code to the case you referred to I realized that instead of dividing the "ods excel file" and "ods excel options" into two lines of code and put it on the same line I actually got a Table of Contents. It is not very pretty and I get some lines in my table of contents that I would rather not have;

"Report"

"Table 1"

 

But still, good progress!

 

ods excel file="&ROOTDIR.&FILENAME..xlsx"
          options(embedded_titles='YES' contents='yes' autofilter='on' sheet_interval='proc');
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Great, you can mark your own response as the correct answer.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 2332 views
  • 0 likes
  • 2 in conversation