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
SAS Super FREQ
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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 842 views
  • 0 likes
  • 2 in conversation