Hi,
I want to calculate winsorized means for quite many (several thousands) of class variables and later use these results in other procedures so I need to get them in data set.
With the following code it works fine for small number of class variables, but if there are many, log and listing just gets too crowded.
ods trace on ;
ods output winsorizedmeans=means (keep= classvar mean rename=mean=winsorized_mean) ;
proc univariate winsorized = 0.10 data=mydata;
class classvar;
var var1 ;
run ;
ods trace off ;
Could anyone please suggest me what to do? I know how to change so that there is no listing output, but that doesn't solve huge log problem.
Maybe I'm just doing it in too complicated way and there is easier way to get winsorized mean values?
Thank you,
Ieva
You don't need ods trace on to run, unless you need it for some other reason. I'm guessing thats what's filling your log.
Google proc printto to see how to redirect your log to a file.
Try the following though, it should create the dataset with minimal output.
ods select none;
proc univariate winsorized = 0.10 data=mydata;
class classvar;
var ;
ods output winsorizedmeans=means (keep= classvar mean rename=mean=winsorized_mean) ;
run ;
Do you have this in a macro loop. Otherwise, I don't see how you could be filling up the log. Maybe the Forum software "ate" some of your code? I am also seeing an empty VAR statement, which doesn't look right.
Without the code to guide me, try this:
%macro ODSOff();
ods graphics off;
ods <dest> exclude all;
ods noresults;
%mend;
%macro ODSOn();
ods results;
ods <dest> exclude none;
ods graphics on;
%mend;
Replace <dest> with whatever destingation you are using (sounds like LISTING.)
Before the UNIVARIATE code, use %ODSOff, and after the proc call use %ODSOn.
(Of course, you also want ODS TRACE OFF.)
You don't need ods trace on to run, unless you need it for some other reason. I'm guessing thats what's filling your log.
Google proc printto to see how to redirect your log to a file.
Try the following though, it should create the dataset with minimal output.
ods select none;
proc univariate winsorized = 0.10 data=mydata;
class classvar;
var ;
ods output winsorizedmeans=means (keep= classvar mean rename=mean=winsorized_mean) ;
run ;
Thank you Rick and Reeza for fast and useful answers! Now everything is working just great!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.