This this small modification to the (LINE) section of the code supplied by Chris.
[pre]
options ls=64;
proc report data=sashelp.class nowd list;
column SEX AGE WEIGHT ;
define SEX / group;
define AGE / group;
define WEIGHT / analysis sum;
compute after AGE ;
if AGE>13 then TOTAL + WEIGHT.sum;
endcomp;
compute before SEX;
TOTAL=.;
endcomp;
compute after SEX;
line = catx(' ','Sum for', sex,'age > 13:',total);
l = length(line);
if sex eq 'F' then l=0;
line @20 line $varying50. l;
*line @ 20 ' Sum for ' SEX $1. ' age > 13: ' TOTAL 4.;
endcomp;
run;
[/pre]