Navigational buttons can be added to the HTML file a number of ways. One way is to use PROC TEMPLATE as illustrated below using the POSTHTML= attribute in the style element Table if the button is to appear after every table, or the style element Body if it is to appear once after all tables. You can also append the HTML to the end of the file, and you can add HTML tags to the FOOTNOTE statement. View output.
/* The below opens the the SAS web site when the button is clicked. */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="SAS"
onclick=javascript:window.open("http://www.sas.com")></div>';
end;
run;
/* The below includes both a BACK button and a window open button */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()"></div>' ;
end;
run;
/* The below example adds a button to close the window */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()">
<input type="button" value="FORWARD"
onclick="history.forward()">
<input type="button" value="CLOSE WINDOW"
onclick=javascript:window.close()></div>' ;
end;
run;
/* The final example adds a print button */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()">
<input type="button" value="FORWARD"
onclick="history.forward()">
<input type="button" value="CLOSE WINDOW"
onclick=javascript:window.close()>
<input type="button" value="PRINT PAGE"
onclick=javascript:window.print()></div>' ;
end;
run;
ods html body='temp.html' style=styles.test;
proc print data=sashelp.class;
run;
ods html close;
See also the SAS Notes for ODS.