Hi:
Well, if you want your statistic in a separate cell, then you have a slightly different challenge. If I were dealing with just PROC MEANS output, I wouldn't use the ODS ESCAPECHAR trick at all (which as you noted, actually does stack the 2 statistics together in one cell). Instead, I would "transpose" the data and then use PROC REPORT.
Here's the PROC MEANS example using TRANSPOSE and a PICTURE format and PROC REPORT to get parentheses around Height_Max (and only Height_Max).
[pre]
ods output summary=work.mnout;
proc means data=sashelp.class nway min max;
var height;
class age;
run;
proc transpose data=work.mnout out=work.trout;
by age;
run;
proc print data=work.trout;
title 'After Transpose, what are variables';
run;
** create a picture format to add parentheses.;
** could also create a character variable with parentheses, instead.;
proc format;
picture paren low-high='00099.99)' (prefix='(');
run;
ods html file='c:\temp\transposed.html' style=sasweb;
proc report data=work.trout nowd;
title 'PROC REPORT with CALL DEFINE puts parens around Max';
column age _label_ col1;
define age /order order=data 'Age';
define _label_ / order order=data 'Statistic';
define col1 / display 'Value';
compute col1;
if _label_ = 'Maximum' then do;
call define (_col_,'format','paren.');
end;
endcomp;
run;
ods html close;
[/pre]
Remember that SAS, when it makes a tabular report, generally wants every report row to have the same number of columns, so for example, if I was doing a report on SASHELP.CLASS, it would not be a "normal" tabular report for me to have NAME, AGE and HEIGHT on 1 report row and to have WEIGHT underneath HEIGHT or WEIGHT underneath AGE on the next report row.
So, if you do capture the output from PROC REG into 2 different datasets, you will then have to bring those datasets together in a way that makes sense. For example, this code:
[pre]
ods output fitstatistics=work.fs
parameterestimates=work.pe;
proc reg data=sashelp.class;
model age=height;
run;
quit;
proc print data=work.fs;
title 'Fit Statistics Stored in Dataset';
run;
proc print data=work.pe;
title 'Parameter Estimates Stored in Dataset';
run;
[/pre]
creates these 2 output datasets, WORK.FS and WORK.PE, as shown below:
[pre]
*** *** *** WORK.FS *** *** ***
Fit Statistics Stored in Dataset
Obs Model Dependent Label1 cValue1 nValue1 Label2 cValue2 nValue2
1 MODEL1 Age Root MSE 0.89767 0.897674 R-Square 0.6584 0.658426
2 MODEL1 Age Dependent Mean 13.31579 13.315789 Adj R-Sq 0.6383 0.638333
3 MODEL1 Age Coeff Var 6.74143 6.741428 0
*** *** *** WORK.PE *** *** ***
Parameter Estimates Stored in Dataset
Obs Model Dependent Variable DF Estimate StdErr tValue Probt
1 MODEL1 Age Intercept 1 -1.41049 2.58074 -0.55 0.5918
2 MODEL1 Age Height 1 0.23624 0.04127 5.72 <.0001
[/pre]
Important to note is that the 2 datasets have 2 different structures. The Fit Statistics dataset has different column names than the Parameter Estimates dataset.
Again, what you want to achieve is do-able, but you may have to do a bit of data manipulation to get the report layout (report rows and columns) that you want.
cynthia