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.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

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