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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ


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

5 REPLIES 5
ballardw
Super User

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";

Doc_Duke
Rhodochrosite | Level 12

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

ballardw
Super User

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

Cynthia_sas
SAS Super FREQ


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

Doc_Duke
Rhodochrosite | Level 12

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

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
  • 5 replies
  • 5641 views
  • 0 likes
  • 3 in conversation