07-12-2012 10:56 AM
I frequently write SAS macros that call SAS procedures thousands of times. I would like to prevent any output from being created other than ODS outputs that I request from the procedures. However, some procedures like SurveyReg seem to send copious output to the lisitng file or the HTML destination no matter what I try. It is particularly annoying in interactive mode. Is there any way to prevent the results window from being populated?
07-12-2012 11:37 AM
I work with SAS EG. I use proc printto to save log output into specified location. I hope it can be used also for output.
proc printto log='Path of the file' new;
The keyword NEW will update the file every time you run the code.
To cancel this:
Hope it will help.
07-12-2012 12:03 PM
You can close the listing destination, ie
ods listing close; *to turn off output;
ods html close;
ods listing; *to turn on;
And you can use proc printto to redirect the log.
07-12-2012 01:21 PM
Thanks, but neither "ods listing close" nor "ods html close" prevent the results windw from filling up. Also, Proc printto just sends things somewhere else. I want it all to disappear without a trace into the ether.
07-12-2012 01:40 PM
What results window are you referring to? And what version of SAS and output destination are you using?
Turning on ods listing close; is supposed to make all the results disappear into the ether.
ods listing close;
proc print data=sashelp.class;
You shouldn't have anything go to any output destination then. If it still is, post a sample of the code you're using to see where the error might be.
07-12-2012 02:12 PM
In interactive mode of SAS (both 9.2 and 9.3) there is a "Results" window that holds a bookmark for every output data set created by every proc. When running a simulation job, the number of bookmarks can be very large.
07-12-2012 02:48 PM
Then ods listing close will definitely work.
So there's something else in your code that is causing issues which I can't tell without seeing the code.
When you run the code below do you get the entry in the result tab and in the listing or html output?
ods _all_ close;
title 'is this in my result window?';
proc print data=sashelp.class;
07-12-2012 03:24 PM
Well, the command is successful in preventing a simple proc print output from appearing in the results window, but when I use the following code insided an iteracted do loop with 2000 replications, I get 4000 bookmarks in the results window even after applying ods listing close (interactive mode). There are 2000 bookmarks for "estimates" and 2000 for "joint."
proc surveyreg data=mydata;
class treatment outcome;
'tvalue1' treatment*outcome -1 0 1 0,
'tvalue2' treatment*outcome 0 -1 0 1/
ods ouput estimates=estimates contrasts=joint;
07-12-2012 03:31 PM
The bookmarks hold only the SAS dataset created though, correct?
I don't know a way around that.
You shouldn't have any output in an output window.
07-12-2012 03:41 PM
Correct. Exactly. I have not been able to find a way around it either. Frustrating since filling the results window with all those bookmarks or clearing them all out again does take a noticeable lag of time.
Need further help from the community? Please ask a new question.