The SAS Output Delivery System and reporting techniques

Proc Document Replay with Proc Print by Groups

Reply
Frequent Contributor
Posts: 84

Proc Document Replay with Proc Print by Groups

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;

Respected Advisor
Posts: 3,775

Re: Proc Document Replay with Proc Print by Groups

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;
Ask a Question
Discussion stats
  • 1 reply
  • 362 views
  • 0 likes
  • 2 in conversation