I guess this question might be already posted but not able to find the solution.
proc format; value $gender 'F' = 'Female' 'M' = 'Male';run;
proc report data = sashelp.class;
column sex age name height weight;
define sex/group format = $gender.;
define age/group;
break after sex/summarize;
compute after sex/style(lines)={font_size=1pt cellpadding=0 cellheight=1pt}; line ' ';
sex = 'Total '|| trim(sex);
call define(_row_, "style", "style = [background = orange]");
endcomp;
break after age/summarize;
compute after age/style(lines)={font_size=1pt cellpadding=0 cellheight=1pt};
sex = '';
age = 'Total '|| trim(age);
call define(_row_, "style", "style = [background = lightgray]");
endcomp;
compute name;
if name in ('Jane','Alice','Mary','James','Jeffrey','William','Ronald')
then call define (_col_, "style", "style = [background = lightgreen]");
endcomp;
rbreak after/summarize;
run;
1st issue:
trying to get 'Total Male', 'Total Female' for column sex. Likewise, 'Total age' for the column age, at summary rows. I've also tried to put a length statement in the datastep before proc report, if that increases the length of the column in proc report.
2nd issue:
at the end of the report, need to get total heights and total weights of the names, highlighted in lightgreen color.
Thanks for your help
Message was edited by: nj_sas
... View more