%let name=tabulate;
filename odsout '.';
data mydata;
format population comma12.0;
label st='State';
label population='Population';
input st $ 1-2 population;
year=2000;
datalines;
VA 7078515
NC 8049313
SC 4012012
GA 8186453
FL 15982378
;
run;
proc format;
VALUE $COMPND
'VA'='VA'
'NC'='NC'
'SC'='SC'
'GA'='GA'
'FL'='FL';
run;
ODS LISTING CLOSE;
ODS HTML path=odsout body="&name..htm"
(title="ODS HTML Drilldown via user-defined format in 'proc tabulate'")
style=htmlblue;
title1 color=black h=.25in "Year 2000 U.S. Census Population";
title2 color=gray "Proc Tabulate w/ ODS HTML Drilldown via user-defined format";
footnote color=gray "(click underlined text to drilldown)";
options nodate;
proc tabulate data=mydata format=comma12.0;
format st $compnd.;
format population comma12.0;
class year st;
var population;
table year,st*population=''*sum='';
run;
quit;
ODS HTML CLOSE;
ODS LISTING;