16.4.08

Different ODS Footers

If suppose we have ten observations and we are required to present the output such that the observation are distributed on different pages depending on the value of the variable “order”. Also the different pages need to have different footers , footers being presented in the body of the document.As a first step, a variable "page" is created which represents the page number corresponding to the observation in the dataset as described below.

data catval1;
set catval end=eof;
if order le 4 then page=1;
else if 5 le order le 7 then page=2;
else if order ge 8 then page=3;
run;

The footers can be presented in the body of the document using compute before /after statements in proc report as below.

proc report data= catval1 ;
column order var1 var2 ;
………………………………
………………………………
Other SAS statements;
…………………………………
………………………………..
compute before page;
If page=1 then footer= "\li75 @ Subjects who select more than one race” ;
If page=2 then footer=" ";
If page=3 then footer="\li75 + BMI = Weight (kg) / [Height (m)]^2";
endcomp;

/*here _page_ is the SAS generated variable */

compute after _page_ / style=[just=l protectspecialchars=off];
footer11= footer;
footer12="\li75 # Overall p-value for continuous variables “
footer13="\li for Categorical variables from CMH general association test";
line @1 footer11 $300.;
line @1 footer12 $300.;
line @1 footer13 $300.;
endcomp;

/* this will give different footers in each page*/
by page;
run;

The first page will contain the following footers

@ Subjects who select more than one race
# Overall p-value for continuous variables
for Categorical variables from CMH general association test

The second page will contain the following footers

# Overall p-value for continuous variables
for Categorical variables from CMH general association test

The third page will contain the following footers
+ BMI = Weight (kg) / [Height (m)]^2
# Overall p-value for continuous variables
for Categorical variables from CMH general association test

No comments: