BookmarkSubscribeRSS Feed
data_null__
Jade | Level 19

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;
1 REPLY 1
data_null__
Jade | Level 19

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;

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
  • 1145 views
  • 1 like
  • 1 in conversation