If you remove the STARTPAGE=NO option, do the bookmarks work as expected? I would think that turning off page breaks may impact the linking. It may also depend on if you are creating tables or graphs or adding images or a combination of all.
Also we don't know what your Custom style is doing. You can try to simplify the problem by first commenting that out. Do you still replicate the problem? If so, it is not the style. Then try commenting out STARTPAGE. Then, if you don't replicate the problem, then it could be related to the interaction with page breaks.
That being said, there are known issues with PDF bookmarks, so I would suggest opening a Case with Technical Support and send a small example with code and output that replicates the problem for them to investigate further.
'If you remove the STARTPAGE=NO option, do the bookmarks work as expected?"
No change, I am creating tables only; we have no graphs and no images at all in this given report.
"Also we don't know what your Custom style is doing. You can try to simplify the problem by first commenting that out. Do you still replicate the problem?" Yes, the problem persists.
"Then try commenting out STARTPAGE. Then, if you don't replicate the problem, then it could be related to the interaction with page breaks." Yes, I still get the issue with Startpage removed.
When I turn on the TOC, the issue goes away in many configurations, including with "all my other options turned on" -it works. I am not sure, but am checking with customers to see if having the TOC turned on is acceptable. I am hoping they will but have no idea... It does, of course, add a few leading pages to the document.
"That being said, there are known issues with PDF bookmarks, so I would suggest opening a Case with Technical Support and send a small example with code and output that replicates the problem for them to investigate further."
I will share this with my other staff to see what they say. Thank you for the assistance.
The NOBOOKMARKGEN option on the ODS PDF statement will suppress the Bookmarks. Is that what you are talking about?
ods listing close;
ods pdf file='c:\temp\test.pdf' nobookmarkgen;
proc print data=sashelp.class;
run;
ods pdf close;
ods listing;
...no I was joking. It does not really make sense to create the TOC but not display it, but that is a feature for bookmarks to hide them (you can activate them from within the output file). If I could create the TOC and hide it, I would not have this issue; my report would be 100% what my users expect.
There is also the BOOKMARKLIST=HIDE option on the ODS PDF statement. I would suggest that you check out all the Bookmark and Contents options documented here:
"There is also the BOOKMARKLIST=HIDE option on the ODS PDF statement. I would suggest that you check out all the Bookmark and Contents options documented here:"
I am sorry my joke must have run flat.
I know and understand the hide bookmarks option. It does not help me. The bookmarks are desired 'on' + 'displayed', but they have to work correctly. The only combination I have found that fixes the bookmarks for me is when the TOC is also 'on'.
Thus, the joke is about hiding the TOC and having the bookmarks work while hiding the undesired TOC. There is no TOC hide option...
Right now I have no idea how to debug your issue since I cannot recreate it.
Can your create a program using available datasets, like those in SASHELP library? Or dataset(s) you can create using simple data steps. That makes incorrect bookmarks in the PSF file?
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →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.
Ready to level-up your skills? Choose your own adventure.