Hi:
But, the DYNAMIC statement is in effect when you use the DEFAULT template without making any changes and you still do NOT get the name/label of the analysis variable listed beside the CLASS var. That behavior ONLY happens, by default, when you have 2 or more analysis variables.
So, the DYNAMIC statement is not at fault. even if you add a DYNAMIC statement back into your template, with ONE variable, PROC MEANS uses the default behavior.
Depending on what you want, PROC TABULATE can use a variable list for the VAR statement, same as PROC MEANS. Here's a little test. I didn't bother with a %DO loop.
cynthia
[pre]
%macro dotab(clvar=, varlist=);
proc tabulate data=sashelp.class;
var &varlist;
class &clvar;
table &clvar=' ' *(&varlist),
n mean stddev min max /row=float box=&clvar;
run;
%mend dotab;
ods pdf file='c:\temp\testmac.pdf' ;
title "One Analysis Var";
%dotab(clvar=sex, varlist=age);
run;
title "Two Analysis Vars";
%dotab(clvar=sex, varlist=age weight);
run;
title "Three Analysis Vars";
%dotab(clvar=sex, varlist= age height weight);
run;
ods pdf close;
[/pre]