Data visualization with SAS programming

How to close results viewer programatically - SAS 9.1.3

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

How to close results viewer programatically - SAS 9.1.3

I am using ODS to output a pdf file with some graphs and I have everything how I want it except I need the results viewer to close after the code runs.  I can't do it based on changing the SAS options through the options menu or anything like that because the code will run on another machine and I cannot guarantee if that user will have their options configured that way.  Is there any way to do this programatically?

I found what looks to be one solution (link below) but it appears to change the SAS registry and I do not want to do that on someone else's machine.  If that option doesn't do anything permanent then I would assume that would work, I am not familiar with what the impacts of that code are.

http://support.sas.com/kb/13/128.html

Thanks


Accepted Solutions
Solution
‎08-15-2012 10:31 AM
Valued Guide
Posts: 765

Re: How to close results viewer programatically - SAS 9.1.3

hi ... if all you want is the PDF output, have you tried ...

ods listing close;

ods results off;

ods pdf file='z:\test.pdf' notoc;

* example plots;

proc gtestit pic=2;

run;

proc gplot data=sashelp.class;

plot weight*height;

run;

quit;

ods pdf close;

ods results;

ods listing;

View solution in original post


All Replies
Solution
‎08-15-2012 10:31 AM
Valued Guide
Posts: 765

Re: How to close results viewer programatically - SAS 9.1.3

hi ... if all you want is the PDF output, have you tried ...

ods listing close;

ods results off;

ods pdf file='z:\test.pdf' notoc;

* example plots;

proc gtestit pic=2;

run;

proc gplot data=sashelp.class;

plot weight*height;

run;

quit;

ods pdf close;

ods results;

ods listing;

Contributor
Posts: 27

Re: How to close results viewer programatically - SAS 9.1.3

Well how about that, that did the trick.  I didn't think it would work because when I googled the issue at first I found this:

http://support.sas.com/kb/31/789.html

I guess that link describes an issue that shouldn't happen instead of how to keep the results viewer from opening.

Thanks for the help!

Super Contributor
Posts: 1,636

Re: How to close results viewer programatically - SAS 9.1.3

Hi Mike,

What does "notoc" do in "ods pdf file='z:\test.pdf' notoc;"?

Thank you!

Valued Guide
Posts: 765

Re: How to close results viewer programatically - SAS 9.1.3

hi Linlin ... no table of contents (eliminates the bookmarks that are added by default)

Super Contributor
Posts: 1,636

Re: How to close results viewer programatically - SAS 9.1.3

Thank you Mike!  but I can't see the difference from the outputs:smileysilly:.

Valued Guide
Posts: 765

Re: How to close results viewer programatically - SAS 9.1.3

hi ... two examples, one with bookmarks (a table of contents), one without (using the NOTOC option)

Super Contributor
Posts: 1,636

Re: How to close results viewer programatically - SAS 9.1.3

Thank you Mike! I see the difference.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 530 views
  • 2 likes
  • 3 in conversation