The SAS Output Delivery System and reporting techniques

Nuisance .png files with ODS RTF output

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 2,113
Accepted Solution

Nuisance .png files with ODS RTF output

Hi,

When I run ODS graphics in batch, I get these nuisance .png files that in the directory where I am running the program.  For instance, with the attached sample, a file called histogram.png will be created in addition to being placed into the ODS RTF destination. 

I am using the recommended graphics options from http://support.sas.com/kb/32/474.html .

With one file it is a minor nuisance, but I run some reports that generate 00's of them.  Is there an option to keep them from appearing or maybe a way to systematically redirect them to the bit-bucket?

Thanks,

Doc

Attachment

Accepted Solutions
Solution
‎05-14-2012 02:46 PM
SAS Super FREQ
Posts: 8,743

Re: Nuisance .png files with ODS RTF output


Hi:

  Interesting thing about your code...why do you have GOPTIONS before your ODS RTF step? ODS GRAPHICS will completely ignore your GOPTIONS. I wonder whether you are getting the stray PNG file because the LISTING destination or the HTML destination is accidentally left on and/or your GOPTIONS device=PNG is confusing things.

  That Tech Support note refers ONLY to the GOPTIONS that you need with classic SAS/GRAPH but when you are using ODS GRAPHICS ON with PROC UNIVARIATE, you are NOT using "classic" SAS/GRAPH. I am not exactly how things work in batch mode, but if you are using EG, for example, you might want to turn off any automatic ODS files that EG might be creating by preceding your code with

ODS _ALL_ CLOSE;  too.

  If you absolutely need to change the image format for RTF, then the appropriate option is:

ods graphics / imagename='koala' imagefmt=png;   <--- NOT GOPTIONS!

cynthia

View solution in original post


All Replies
Super User
Posts: 10,516

Re: Nuisance .png files with ODS RTF output

I found that annoying as well. They seem to use the "active" folder which can get set from the "open program" dialog box.

The code below helps IF I remember to run it as needed (after using the open program or save program dialog). The PNGs end up in the WORK folder.

 

%let workpath=%sysfunc(pathname(work));

/*WORKPATH HAS THE LOCATION, now to find a way to put PNG there

This is supposed to change the current folder*/

x "cd &workpath";

Trusted Advisor
Posts: 2,113

Re: Nuisance .png files with ODS RTF output

I just tried that.  Unfortunately, it put my .rtf  file there too (and then deleted it at the end of the batch run). 

Super User
Posts: 10,516

Re: Nuisance .png files with ODS RTF output

I usually provide explicit paths for any of my ODS RTF output so I hadn't noticed that behavior.

Solution
‎05-14-2012 02:46 PM
SAS Super FREQ
Posts: 8,743

Re: Nuisance .png files with ODS RTF output


Hi:

  Interesting thing about your code...why do you have GOPTIONS before your ODS RTF step? ODS GRAPHICS will completely ignore your GOPTIONS. I wonder whether you are getting the stray PNG file because the LISTING destination or the HTML destination is accidentally left on and/or your GOPTIONS device=PNG is confusing things.

  That Tech Support note refers ONLY to the GOPTIONS that you need with classic SAS/GRAPH but when you are using ODS GRAPHICS ON with PROC UNIVARIATE, you are NOT using "classic" SAS/GRAPH. I am not exactly how things work in batch mode, but if you are using EG, for example, you might want to turn off any automatic ODS files that EG might be creating by preceding your code with

ODS _ALL_ CLOSE;  too.

  If you absolutely need to change the image format for RTF, then the appropriate option is:

ods graphics / imagename='koala' imagefmt=png;   <--- NOT GOPTIONS!

cynthia

Trusted Advisor
Posts: 2,113

Re: Nuisance .png files with ODS RTF output

Cynthia,

Thanks.  It appears that the file was for the listing destination.  I added an

ods _all_ close;

and removed the GOPTIONS and it now works cleanly.

I've picked up most of my ODS knowledge from looking at EGuide logs.  EGuide doesn't have this problem and doesn't use the listing destination.

Doc

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 1623 views
  • 0 likes
  • 3 in conversation