Hi:
You will use a COMPUTE BEFORE...either COMPUTE BEFORE CITY or COMPUTE BEFORE _PAGE_ (if you have/want every city to start a separate page). In this instance (COMPUTE BEFORE), you would have a NOPRINT option on the DEFINE statement for CITY and CITY would need to be an ORDER usage report item. In addition, you will use a LINE statement to actually write the value of CITY at the top of the ROWS for that CITY. Something like this (untested code), which assumes that your variables are CITY, GENDER, NAME, HEIGHT, WEIGHT and AGE...and that you want the MEAN statistic for the GENDER summary line for each group:
[pre]
ods html file='compute_before_noby.html' style=sasweb;
proc report data=your_data nowd;
column city gender name height weight age;
define city / order noprint;
define gender / order;
define name / order;
define height /mean;
define weight / mean;
define age / mean;
break before gender / summarize;
compute before city/
style={just=l};
cline = 'City: '||trim(city);
clg = length(cline);
line cline $varying. clg;
endcomp;
run;
ods html close;
[/pre]
But an alternative to this approach would be to use BY CITY inside PROC REPORT and then to use the CITY name in the TITLE statement. However, this would mean that every CITY would be placed in a separate table (and if you were using ODS RTF or ODS PDF -- every table would start on a separate page). But this would also allow the use of #BYVALn syntax in the TITLE statement, which would take the place of the COMPUTE BEFORE block. Something like this:
[pre]
proc sort data=your_data;
by city;
run;
options nobyline;
ods html file='use_break_and_by.html' style=sasweb;
proc report data=your_data nowd;
column city gender name height weight age;
by city;
title j=c 'City: #byval1';
define city / order noprint;
define gender / order;
define name / order;
define height /mean;
define weight / mean;
define age / mean;
break before gender / summarize;
run;
ods html close;
options byline;
title;
[/pre]
So it's partly going to be a trade-off between how it looks with COMPUTE BEFORE CITY, versus COMPUTE BEFORE _PAGE_ versus using a BY statement and how well you understand PROC REPORT syntax or how much learning about PROC REPORT syntax you want to do.
These are some good papers on PROC REPORT:
http://support.sas.com/resources/papers/ProcReportBasics.pdf
http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf
http://support.sas.com/resources/papers/proceedings10/133-2010.pdf
http://support.sas.com/resources/papers/proceedings10/141-2010.pdf
http://www2.sas.com/proceedings/sugi30/244-30.pdf
http://www.caloxy.com/papers/65_HOW07.pdf
http://support.sas.com/resources/papers/proceedings09/026-2009.pdf
cynthia