When I re-arrange ODS Document entries to get a flat navigation pane, then the auto generated TOC by SAS does link the wrong page.
Background: I have a BY-Statement PROC REPORT and do not want to have the single BY groups linked. For this I shift the two reports one level higher in ODS Document. I get the desired navigation in PDF and the TOC is looking correct, but when I click "Table 2" in the TOC is goes to the last page of "Table 1".
Question: Why is the TOC linking incorrect and is there a way to change this without using a manual TOC where I need to calculate all page numbers manually?
Condition: The BY-Statement in PROC REPORT is a must and cannot be omitted.
The example program is attached. This program is creating this issue in the University Edition.
As no one seems to have an idea it seems to be a SAS bug, so I will bring this topic to the SAS Support.
Please define what you mean by "links to incorrect page".
When I run your code the TOC entry for By groups links to the first by group table. Is that not what you expect? Or did you want the by group tables to be the second entry with the tables after the full table?
Thank you for using a SASHELP data set for the example by the way.
Thanks Ballardw for looking into the issue. When you run the complete source including the ODS Document modification, you will see the from me expected navigation and TOC:
If you now click on the TOC "Table 2", then it will bring you to page 2 (actual page 3) where the second BY group is located and not to the correct "Table 2" page:
If you click the navigation on the left pane it will link to the correct page.
May be another issue. I did run your code as posted.
Clicking in the table of contents page itself doesn't take me anywhere. That could be my SAS version, which is 9.4 release 4, my particular Adobe Reader version or something else entirely.
I'm not an expert on PDF and seldom use them so haven't delved into many details. Maybe someone else will have a better handle.
As no one seems to have an idea it seems to be a SAS bug, so I will bring this topic to the SAS Support.
I am using a workaround to use single ODS Documents instead of one big ODS document. Another workaround would be to create the TOC manually as described here: https://www.mwsug.org/proceedings/2012/S1/MWSUG-2012-S125.pdf
I have created an open source macro to perform ODS Document combining into PDFs, you might want to checkout here:
https://katjaglassconsulting.github.io/SMILE-SmartSASMacros/test_smile_ods_document_flat_label/
Examples are also available in the corresponding GitHub site (https://github.com/KatjaGlassConsulting/SMILE-SmartSASMacros/).
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!
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.