![]() | ![]() | ![]() |
The links are somewhat malformed in SAS 8.2 (see FAQ 4150; this has been fixed in SAS 9). But the error in the formation of the links will not cause a problem for most of you. So here is the theory of how they are supposed to work (and they nearly do work this way).
To generate a link in PDF, use the same mechanism that you use in HTML; either the URL= style attribute or the _URL_ property in PROC REPORT. The difference lies in how they are interpreted:
How to Link to Other Pages within an ODS PDF File
Beginning with SAS 9, you can link to any page within the PDF file. The example code here works with SAS 9 and later.
Like other destinations, the PDF destination automatically generates link names with the following naming convention: IDX-IDXn. See example 1 below.
Example 2 is the preferred method of linking. Instead of using the automatic anchors, the ANCHOR= option specifies #PRINT, #STANDARD, and #TRANSPOSED on the ODS PDF statements. However, if a single procedure (like GLM) produces many tables, then example 1 is the only alternative.
/* Example 1 */
proc template;
define style styles.mystyle;
parent=styles.printer;
style UserText from Note
"Controls the TEXT= style" /
font_size=15pt
font_weight=bold
just=c
;
end;
run;
ods pdf file="tt.pdf" style=styles.mystyle;
ods escapechar="^";
title "Contents";
ods pdf text="^S={URL='#IDX'}PROC PRINT";
ods pdf text="^S={URL='#IDX1'}PROC STANDARD";
ods pdf text="^S={URL='#IDX2'}Transposed";
proc print data=sashelp.class;
title 'PRINT';run;
proc standard data=sashelp.class print;
title "STANDARD"; run;
proc transpose data=sashelp.class; run;
proc print;
title "Transposed" ; run;
ods pdf close;
/* Example 2 */
proc template;
define style styles.mystyle; parent=styles.printer;
style UserText from Note "Controls the TEXT= style" /
font_size=15pt
font_weight=bold
just=c
;
end;
run;
ods pdf file="tt.pdf" style=styles.mystyle;
ods escapechar="^";
title "Contents";
ods pdf text="^S={URL='#print'}PROC PRINT";
ods pdf text="^S={URL='#standard'}PROC STANDARD";
ods pdf text="^S={URL='#transposed'}Transposed";
title 'The SAS System';
ods pdf anchor="print";
proc print data=sashelp.class; title "PRINT" ; run;
ods pdf anchor="standard";
proc standard data=sashelp.class print; title "STANDARD"; run;
ods pdf anchor="transposed";
proc transpose data=sashelp.class; run;
proc print; title "Transposed"; run;
ods pdf close;
| Product Family | Product | System | Reported Release | Fixed Release* |
| SAS System | Base SAS | All | n/a |
| Type: | Usage Note |
| Priority: | low |
| Topic: | System Administration ==> Printing Third Party ==> Output ==> PDF SAS Reference ==> ODS (Output Delivery System) |
| Date Modified: | 2006-01-20 12:04:06 |
| Date Created: | 2004-09-30 12:20:06 |



