I'm trying to write a simple proc print to PDF and use proc document to rename the PDF bookmarks (this part works) but I noticed it removes my BY groupings in the PDF (only after running the PROC DOCUMENT step). The code below prints 9 pages of the same output with no page breaks by the BY variable. Is there any way to rename the PDF bookmarks but keep the BY variable grouping to be on individual pages? Thanks!
ods listing;
options nobyline nonumber nodate orientation=landscape;
ods document name=myreport(write);
ods pdf file='test.pdf' style= BarrettsBlue;
proc print data=setOrder noobs; by Region; run;
ods pdf close;
ods document close;
proc document name=myreport(update);
ods listing;
list / levels=all; run;
ods listing close;
setlabel Print#1\ByGroup1#1\Print#1 "";
setlabel Print#1\ByGroup2#1\Print#1 "";
setlabel Print#1\ByGroup3#1\Print#1 "";
setlabel Print#1\ByGroup4#1\Print#1 "";
setlabel Print#1\ByGroup5#1\Print#1 "";
setlabel Print#1\ByGroup6#1\Print#1 "";
setlabel Print#1\ByGroup7#1\Print#1 "";
setlabel Print#1\ByGroup8#1\Print#1 "";
setlabel Print#1\ByGroup9#1\Print#1 "";
run;
ods pdf file='test.pdf' style=BarrettsBlue pdftoc=1;
replay l; run;
ods pdf close;
ods listing close;
quit;
I don't understand your term "by groupings" You have the option NOBYLINE which removes the by line is that what you're talking about. You didn't supply data for your program.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.