BookmarkSubscribeRSS Feed
P5C768
Obsidian | Level 7

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;

1 REPLY 1
data_null__
Jade | Level 19

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.


options byline=1 number=0 date=0;* orientation=landscape;

ods document name=myreport(write);
ods pdf file='~/test.pdf' style= BarrettsBlue;
proc sort data=sashelp.class out=class; by age; run;
proc print data=class noobs; by age; pageby age; 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 "";

run;

ods pdf file='~/test2.pdf'  style=BarrettsBlue pdftoc=1;
 
replay; run;
ods pdf close;
quit;
options byline=1 number=1 date=1;* orientation=landscape;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1 reply
  • 1073 views
  • 0 likes
  • 2 in conversation