proc report data=sashelp.class;
columns sex age height weight;
define sex/group;
define age/group;
define height/analysis mean format=10.2 "Height Mean";
define weight/analysis mean format=10.1 "Weight Mean";
break after sex/summarize style=[font_style=italic];
rbreak after/summarize style=[font_style=italic];
run;
I would like the BREAK rows to have the text at the left hand side in column 1 "Female Mean" or "Male Mean", and in the RBREAK row I'd like the text "Overall Mean". How can this be done?
data class;
length sex $ 40;
set sashelp.class;
sex=ifc(sex='F','Female','Male');
run;
proc report data=class nowd;
columns sex age height weight;
define sex/group;
define age/group;
define height/analysis mean format=10.2 "Height Mean";
define weight/analysis mean format=10.1 "Weight Mean";
break after sex/summarize style=[font_style=italic];
rbreak after/summarize style=[font_style=italic];
compute after sex;
sex=catx(' ',sex,'Mean');
endcomp;
compute after;
sex=catx(' ','Overall','Mean');
endcomp;
run;
data class;
length sex $ 40;
set sashelp.class;
sex=ifc(sex='F','Female','Male');
run;
proc report data=class nowd;
columns sex age height weight;
define sex/group;
define age/group;
define height/analysis mean format=10.2 "Height Mean";
define weight/analysis mean format=10.1 "Weight Mean";
break after sex/summarize style=[font_style=italic];
rbreak after/summarize style=[font_style=italic];
compute after sex;
sex=catx(' ',sex,'Mean');
endcomp;
compute after;
sex=catx(' ','Overall','Mean');
endcomp;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.