BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
polarjud
Calcite | Level 5

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
11 REPLIES 11
ElenaT
Calcite | Level 5


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;

run;

The keyword NEW will update the file every time you run the code.

To cancel this:

proc printto;

run;

Hope it will help.

Reeza
Super User

You can close the listing destination, ie

ods listing close; *to turn off output;

ods html close;

ods html;

ods listing; *to turn on;

And you can use proc printto to redirect the log.

polarjud
Calcite | Level 5

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. 

Reeza
Super User

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;

run;

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.

polarjud
Calcite | Level 5

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. 

Reeza
Super User

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;

run;

ods listing;

polarjud
Calcite | Level 5

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;

  cluster mycluster;

  class treatment outcome;

  model myvar=treatment*outcome/solution;

  weight myweight;

  estimate

    'tvalue1'  treatment*outcome -1 0 1 0,

    'tvalue2' treatment*outcome 0 -1 0 1/

    joint (label="mylabel");

  ods ouput estimates=estimates contrasts=joint;

run:

Reeza
Super User

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.

polarjud
Calcite | Level 5

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.  

Reeza
Super User
ods noresults;

What does that do?

polarjud
Calcite | Level 5

Eureka!  Thanks.  That does it alright.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 1212 views
  • 2 likes
  • 3 in conversation