BookmarkSubscribeRSS Feed
FrankE
Fluorite | Level 6
Hi guys, I've found several examples of generating a table of contents with the html tagset but for some reason I can't seem to get it working.. Using SAS 9.2 I run:

ods html file="u:\exampl1.html" options(body_toc='yes');
proc print data=sashelp.class;run;
proc print data=sashelp.class;run;
ods _all_ close;

The result is an html doc with both reports but no table of contents off to the side like I would expect. What am I missing?
4 REPLIES 4
Cynthia_sas
Diamond | Level 26
Hi:
BODY_TOC is a valid sub-option for ODS HTMLPANEL, and it has been shown as a sub-option for the new HTML 5 tagset template ... but it is not a sub-option that works with my current production version of the ODS HTML destination tagset (as delivered in 9.2.2).

You can generate an HTML 4 TOC with a "FRAMESET", but you must use different syntax:
[pre]
ods html path='c:\temp' (url=none)
file="exampbod.html"
contents="examptoc.html"
frame="exampfrm.html"
options(doc='Help');
title 'Using regular ODS HTML';
proc print data=sashelp.class;run;
proc print data=sashelp.class;run;
ods _all_ close;
[/pre]

If you look in the SAS log, you will see the valid sub-options for the current ODS HTML destination. To see the TOC, open the FRAME= file -- that is the HTML <FRAME> file that defines how the BODY and CONTENTS files should be displayed.

If your question is about the examples that were in this paper --
http://support.sas.com/resources/papers/proceedings10/005-2010.pdf
that highlighted some of the new changes to the HTML tagset so it would be HTML 5 compliant and not require a FRAME file, then you might want to check out the zip file of examples that is available for download at this site:
http://support.sas.com/rnd/base/ods/odshtml/

Generally, when new features like this are shown at SAS Global Forum it means that you must download an updated tagset template to replicate the paper's examples. And there is a TPL file in that zip download which I suspect contains the HTML 5 tagset template where BODY_TOC has been enabled.

cynthia
FrankE
Fluorite | Level 6
As always, you've been a great help. That was exactly the paper I was looking at and for the life of me couldn't figure out why it wasn't working. Not having the updated html tagset was the issue. Thanks!
FrankE
Fluorite | Level 6
Ok 1 more small problem.. I updated the tagset and for some reason even when the body_toc = 'no' the report is still pushed to the right as if the toc was on.. any ideas?
Cynthia_sas
Diamond | Level 26
Hi:
You might wish to work with Tech Support on this one. If there is a problem in the new tagset template that needs to be fixed, this is the appropriate way to make that change happen.

To open a track with Tech Support, fill out the form at this link:
http://support.sas.com/ctx/supportform/createForm

(and be sure to let them know that you are using the new version of the tagset template and possibly reference your forum post in the track.)

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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