BookmarkSubscribeRSS Feed
tburus
Obsidian | Level 7

I am trying to build a table of contents for a monthly report. The report has several sections I'd like to reference, but their length may vary from month-to-month, so I would like to make the table of contents dynamic rather than hard-coded. I tried defining variables with ^{thispage} on the appropriate pages, but it didn't reference back correctly. Is it possible to get a page number from ODS PDF ANCHOR statements instead? Thanks.

3 REPLIES 3
ballardw
Super User

For "sections" you might try using the ODS PROCLABEL statement as a section title in the TOC.

 

Before the first procedure that creates output in your sections add something like:

 

ods proclabel "Section XXXX";

<some proc code goes here>

 

tburus
Obsidian | Level 7

Thanks. I've done this, but is there anyway to get this to call the page number in a way that I could define a variable that prints the page number out?

ballardw
Super User

@tburus wrote:

Thanks. I've done this, but is there anyway to get this to call the page number in a way that I could define a variable that prints the page number out?


I don't work with PDF to have a clue and gave up trying to calculate page numbers for anything 30 years ago.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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