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
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;
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;
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!
Hi Mike,
What does "notoc" do in "ods pdf file='z:\test.pdf' notoc;"?
Thank you!
hi Linlin ... no table of contents (eliminates the bookmarks that are added by default)
Thank you Mike! but I can't see the difference from the outputs:smileysilly:.
hi ... two examples, one with bookmarks (a table of contents), one without (using the NOTOC option)
Thank you Mike! I see the difference.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.