Usage Note 23434: In ODS HTML output, how can I generate text like "Page 1 of XXX" in the table of pages?
First pre-process the output, getting the last page created, and store this in a macro variable. This macro variable can then be applied in the style element Pagesitem by using the POSTTEXT= attribute. Below is the example code to do this. View output.
filename temp 'c:\test\temp.txt';
proc printto print=temp new;
proc print data=sashelp.class;
run;
proc printto;
run;
data _null_;
infile temp truncover;
input record $1-200;
call symput('lastpage',
trim(left(put(input(reverse(scan(reverse(record),1)),6.)-1,6.))));
stop;
run;
%let lastpage=%eval(&lastpage-1);
proc template;
define style styles.test;
parent=styles.default;
style pagesitem from indexitem /
posttext=" of &lastpage";
end;
run;
ods html body='bod.html'
contents='cont.html'
page='page.html'
newfile=page style=styles.test;
proc sort data=sashelp.class out=temp;
by age;
proc freq data=temp;
by age;
run;
ods html close;
See also the full PROC TEMPLATE FAQ and Concepts.
Operating System and Release Information
*
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: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> HTML
|
Date Modified: | 2003-10-24 10:26:43 |
Date Created: | 2003-09-30 11:04:10 |