Usage Note 24459: How can I use PROC REPORT to link from one page in my PDF file to another?
In SAS 9 and later, the ANCHOR= statement inserts anchors into an ODS PDF output file. You can use PROC REPORT with CALL DEFINE to automate the process of linking to the anchored pages.
proc template;
define style mystyle;
parent=styles.sasdocprinter;
/* TEXT= is left justified by
default. I'd like it centered */
style usertext from note /
just=c;
/* I want PAGEOF information too */
style PageNo from TitlesAndFooters /
font_weight=medium
pretext = "Page "
posttext = " of ^{lastpage}";
end;
run;
title;
/* close the OUTPUT window */
ods listing close;
options orientation=portrait center nodate;
ods escapechar="^";
ods pdf file="file.pdf" startpage=no style=mystyle;
ods pdf text="Click on a highlighted REGION to see details";
ods proclabel="SASHELP.SHOES";
proc report nowd data=sashelp.shoes contents="LINKS Page";
col region sales ;
define region / group;
compute region;
/* for purposes of illustration, we are linking
to 2 regions on later pages in this PDF file */
if region in ("Pacific","Canada") then do;
urlstring="#"||left(region);
call define('_c1_','url',urlstring);
end;
endcomp;
run;
/* create a "footnote" that is placed close to the
REPORT table */
ods pdf text="^2n Prepared on: &sysdate9." ;
/* create an ANCHOR to point to the CANADA page
STARTPAGE= forces this onto a new page
COLUMNS= makes a 2 column page */
ods pdf anchor="Canada" startpage=now columns=2;
title "Canada";
ods proclabel="Canada";
proc report data=sashelp.shoes(where=(region="Canada")) nowd contents="";
col subsidiary product sales;
define subsidiary / group;
define product / group;
rbreak after / summarize;
run;
ods pdf anchor="Pacific" startpage=now;
title "Pacific";
ods proclabel="Pacific";
proc report data=sashelp.shoes(where=(region="Pacific")) nowd contents="";
col subsidiary product sales;
define subsidiary / group;
define product / group;
rbreak after / summarize;
run;
ods pdf close;
See also FAQ 4148.
Operating System and Release Information
| Product Family | Product | System | Reported Release | Fixed Release* |
| SAS System | Base SAS | All | n/a | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | low |
| Topic: | System Administration ==> Printing SAS Reference ==> Procedures ==> REPORT Third Party ==> Output ==> PDF SAS Reference ==> ODS (Output Delivery System)
|
| Date Modified: | 2005-11-30 14:35:24 |
| Date Created: | 2005-11-30 11:29:27 |