Date: Sat, 12 May 2007 08:58:47 -0400
Reply-To: "data _null_;" <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_;" <datanull@GMAIL.COM>
Subject: OUTPUT option may be preferred over ODS OUTPUT.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I know everyone thinks ODS OUTPUT is the "only" way one should request
output from procedures in the modern SAS world. And in many
situations ODS OUTPUT is only way to get statistics into a SAS data
set.
However it is my observation that ODS OUTPUT is slow compared to the
same output produced with a OUTPUT option from a procedure. For
example consider the fellow who wants thousands of R-SQUARE statistics
from PROC REG. This output can be obtained using
ODS OUTPUT FITSTATISTICS
or
RQUARE OUTEST=
The following example keeps the minimum amount of output desired but
ODS is much slower.
Using ODS OUTPUT.
NOTE: PROCEDURE REG used (Total process time):
real time 22.90 seconds
user cpu time 22.84 seconds
system cpu time 0.06 seconds
Memory 252k
NOTE: The data set WORK.FITSTATISTICS has 50000 observations and 4 variables.
Using OUTEST=
NOTE: PROCEDURE REG used (Total process time):
real time 3.34 seconds
user cpu time 3.23 seconds
system cpu time 0.09 seconds
Memory 196k
NOTE: The data set WORK.EST has 50000 observations and 3 variables.
options fullstimer;
proc plan;
factors col1=25 ordered col2=2000 ordered
y=10 of 100 / noprint;
treatments x=10 ordered;
output out=work.reg;
run;
ods listing close;
*ods trace on / listing;
proc reg data=work.reg;
by col:;
model y = x;
ods output FitStatistics= FitStatistics(keep=col: label2 nvalue2
where=(label2='R-Square'));
run;
quit;
*ods trace off;
ods listing;
proc contents varnum data=WORK.FITSTATISTICS;
proc print data=WORK.FITSTATISTICS(obs=20);
run;
proc reg data=work.reg outest=work.est(keep=col: _RSQ_) noprint rsquare;
by col:;
model y = x;
run;
quit;
proc contents varnum data=WORK.est;
proc print data=WORK.est(obs=20);
run;