DATA Step, Macro, Functions and more

Control suppression of ODS output in SAS Enterprise Guide

Reply
Frequent Contributor
Posts: 117

Control suppression of ODS output in SAS Enterprise Guide

[ Edited ]

I am using SAS Enterprise Guide to run simulations with PROC GLIMMIX.  I don't want the results for the thousands of runs to show up in the default SASReport destination and I need to write the random solution to a SAS dataset.  No problem, this code does the trick:

 

ods results OFF;
proc glimmix; by simulationN; model y = x; random r / s; ods output SolutionR=SRout; run;
ods results ON;

However, if I add any code outside of of the RESULTS ON/OFF block, the effects of ODS RESULTS OFF is negated.  For example, if I want to obtain the mean of random estimates and use PROC SQL to calculate that, the results of all 1,000 simulations will be pushed to ODS SASReport which takes a while to write.

 

ods results OFF;
proc glimmix; by simulationN; model y = x; random r / s; ods output SolutionR=SRout; run;
ods results ON;

proc sql; select mean(Estimate) from SRout; quit;

Is this a normal SEG behavior or am I missing something?

 

I cannot use ODS SELECT NONE / EXCLUDE ALL or NOPRINT option because that suppresses the writing of the SolutionR to SAS dataset.

 

The work-around I use is to use ODS _ALL_ CLOSE before PROC GLIMMIX and then re-enable ODS TagSet.SASReport File=EGSR afterwards.  But I would like to understand this strange behavior of ODS RESULTS commands?

 

Thank you in advance!

Respected Advisor
Posts: 3,852

Re: Control suppression of ODS output in SAS Enterprise Guide

[ Edited ]

I haven't tested PROC GLIMIX but I use select none and ODS OUTPUT all the time with PROC MEANS.

 

ods select none;                                                                               
proc means data=&_m._sl n mean std median min max completetypes stackodsoutput;                
   class &trt / order=data preloadfmt mlf missing;                                             
   var &continuous;                                                                            
   ods output summary=&_m._cvars(rename=(variable=_variable_) index=(cvars=(_variable_ &trt)));
   run;                                                                                        
ods select all;                                                                                
Frequent Contributor
Posts: 117

Re: Control suppression of ODS output in SAS Enterprise Guide

[ Edited ]
Posted in reply to data_null__

Thanks for setting me on the right path.  Curiously, the location of ODS SELECT NONE matters.  The code I used does not write SRout dataset:

 

 

proc glimmix; 
 by simulationN; 
 model y = x; 
 random r / s; 
 ods output SolutionR=SRout; 
 ods select none;
run;

 

However, if I switch the two ODS lines, the output is produced just like you suggested:

 

proc glimmix; 
	by simulationN; 
	model y = x; 
	random r / s; 
	ods select none;
	ods output SolutionR=SRout; 
run;

Thanks.

 

Now, why is ODS RESULTS OFF/ON block negated by the PROC SQL that follows it????? 

Ask a Question
Discussion stats
  • 2 replies
  • 39 views
  • 0 likes
  • 2 in conversation