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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 900 views
  • 0 likes
  • 2 in conversation