The SAS Output Delivery System and reporting techniques

PROC DOCUMENT extra bookmark from PROC REPORT

Reply
Respected Advisor
Posts: 3,768

PROC DOCUMENT extra bookmark from PROC REPORT

I'm trying to use PROC DOCUMENT to replay some reports interleaved by a BY group.  Basically page 227 "Modifying PDF Bookmarks Using Links" from Tuchman's PROC DOCUMENT book.

Everything works well enough except that output from PROC REPORT has an extra unwanted bookmark.

4-22-2014 9-51-16 AM.png

There are two bookmarks that point to the same place.  In this case "Asia: Table" and "Table 1" I can omit the SETLABEL statement and get just "Table 1" but of course that's not what I want.  Clicking on either takes you to the same page, but I don't want the second link to the same place obviously. My ultimate goal is a giant PDF with lots of levels of ORIGIN and about 20 or so "Reports" within each.

I get this warning about my PDF

WARNING: Unsupported device 'ACTIVEX' for PDF destination. Using device 'ACTXIMG'.

But I don't think that is the problem and I don't really know what to do about it anyway.


proc sort data=sashelp.cars out=cars;
   by origin;
   run;
data cars;
   retain Studyid '20062004';
  
set cars;
   run;
proc freq data=cars noprint;
  
by studyid origin;
   tables type / out=g100;
   run;
proc template;
  
define statgraph bar100;
      begingraph;
        
layout overlay;
           
BARCHARTPARM X = origin y=percent / group=type;
            endlayout;
        
endgraph;
     
end;
  
run;
options byline=1;

ods document name=docs(write);

ods document dir=(path=\tableA);
proc print data=g100;
   by studyid origin;
   pageby origin;
   run;

ods document dir=(path=\tableB);
proc sgrender data=g100 template=bar100;
   by studyid origin;
   run;
ods document dir=(path=\tableC);
proc report nowd list data=g100;
   by studyid origin; 
  
columns _all_;
   define _all_ / display;
  
run;

ods document close;
*ods trace on;
ods select none;
proc document name=docs;
   ods output Properties=docprop;  
  
list / DETAILS LEVELS=ALL;
   run;
  
ods output close;

  
ods output Properties=docpropby;
   list / BYGROUPS DETAILS LEVELS=ALL;
   run;
  
ods output close;
  
quit;
ods trace off;

ods select all;
proc contents data=docprop varnum;
  
run;
proc print data=docprop;
   run;
proc sort data=docpropby;
   by studyid origin path;
   run;
proc contents data=docpropby varnum;
  
run;
proc print data=docpropby;
   run;
filename FT61F001 temp;
data _null_;
  
file FT61F001;
   set docpropby end=eof;
   by studyid origin;
   if first.studyid then put 'make S' studyid '; dir S' studyid ';';
  
if first.origin then put 'make ' Origin '; dir ' origin ';';
  
link=cats('N',_n_);
   label=catx(':',Origin,type);
   put 'link \work.docs' path 'to ' link ';';
/*   if type ne 'Table' then put 'setlabel ' link label :$quote128. ';';*/
  
put 'setlabel ' link label :$quote128. ';';
  
if last.origin then put 'dir ^^;';
  
run;

proc document name=links(write);
   %inc FT61F001 / source2;
   run;
  
dir \;
   list / DETAILS LEVELS=ALL;
   run;
  
ods pdf file='~/exp.pdf';
  
replay;
  
run;
  
ods pdf close;
  
quit;
filename FT61F001 clear;
Respected Advisor
Posts: 3,768

Re: PROC DOCUMENT extra bookmark from PROC REPORT

It appears that has answered this question here in  Jedi SAS Tricks: Custom Bookmarks

4-22-2014 1-36-00 PM.png

ods document dir=(path=\tableC);
proc report nowd list data=g100 contents='';
  
by studyid origin; 
  
columns _all_;
   define _all_ / display;
  
define studyid / order;
  
define origin / order;
  
break before origin / contents='' page;
  
run;
ods document close;
Post a Question
Discussion Stats
  • 1 reply
  • 383 views
  • 1 like
  • 1 in conversation