BookmarkSubscribeRSS Feed
Athenkosi
Obsidian | Level 7

I'm tried to create a table of contents using the example in the SAS documentation (see the example below). I'm not getting the same results my pdf file does not contain a table of contents, please help.

 

I am using SAS 9.4M4 on SAS EG 7.1

 

title "Create a Table of Contents";
options nodate;
ods pdf file="pathname-to-MyDefaultToc.pdf" contents=yes bookmarklist=hide;
proc print data=sashelp.cars;
run;

proc print data=sashelp.class;
run;
ods pdf close;

 

3 REPLIES 3
CarmineVerrell
SAS Employee

 

I just ran code and here is what I got, a page that has a title of Table of Contents within the PDF, as well as links to the proc prints to sashelp.cars.

 

CarmineVerrell_0-1606221656207.png

 

 

Athenkosi
Obsidian | Level 7

Thanks for the response. If possible may you please attach the pdf file that you generated so I can view it on my side, I suspect this issue has something to do with my Adobe reader setttings

Cynthia_sas
SAS Super FREQ

Hi:

  When I run your code, this is the PDF file I get:

Cynthia_sas_0-1606236412138.png

I am displaying it inside Acrobat Reader in 2 page view. The only thing I changed in your code was THIS:

ods pdf file="c:\temp\MyDefaultToc.pdf" contents=yes bookmarklist=hide;

 

  To direct the output to my C: drive. If you are trying to open the output in EG, you may not be seeing the Table of Contents. One thing you can try is to put  ods _all_ close; before the ODS PDF statement like this:

ods _all_ close;

ods pdf file="c:\temp\MyDefaultToc.pdf" contents=yes bookmarklist=hide;

 

This would turn off all the destinations you might have turned on under Tools-->Options.

 

If you are having issues with ODS PDF, it might be your version of SAS or your version of Acrobat Reader. On the other hand, you may only need to go outside of Enterprise Guide to open the file. I used Windows File Explorer to find the file because I prefer opening the file directly from Windows than from inside Enterprise Guide.

 

Cynthia

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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