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

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

1 ACCEPTED SOLUTION

Accepted Solutions
MikeZdeb
Rhodochrosite | Level 12

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

7 REPLIES 7
MikeZdeb
Rhodochrosite | Level 12

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;

lsirakos
Calcite | Level 5

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!

Linlin
Lapis Lazuli | Level 10

Hi Mike,

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

Thank you!

MikeZdeb
Rhodochrosite | Level 12

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

Linlin
Lapis Lazuli | Level 10

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

MikeZdeb
Rhodochrosite | Level 12

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

Linlin
Lapis Lazuli | Level 10

Thank you Mike! I see the difference.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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