BookmarkSubscribeRSS Feed
BruceBrad
Lapis Lazuli | Level 10

I'm creating HTML and RTF graphics output which produces lots of PNG files (SAS 9.4 TS1M5). Is there a way to get these all deleted at the end of the SAS session?  My setup commands are currently:

ods graphics on /reset=index outputfmt=PNG;
ods rtf  file="[filename].rtf"  image_dpi=300 ;
ods html gpath="[foldername]"  image_dpi=300;
8 REPLIES 8
Reeza
Super User
If you don’t need them try setting gpath to the work library. HTML files may need them though, so check that first.
BruceBrad
Lapis Lazuli | Level 10

1) How can I specify the work folder in the gpath option?

2) I currently have a gpath statement in my ods html statement. I get new png files appearing in this folder. However, I also get them appearing in the same folder as the SAS program. (Except these files are smaller and in b&w rather than colour).

Reeza
Super User

Do you have ODS LISTING destination open or a different one while exporting to HTML/RTF? That may be why those are generated.


You can get the work path by using the following:

%let wpath = %sysfunc(pathname(work));
%put &wpath;
PGStats
Opal | Level 21

ODS RTF doesn't create PNG files but ODS HTML and ODS LISTING do. The HTML main file will refer to those PNG files. If you delete them they won't show in your HTML pages. If neened, you can temporarily stop and restore the production of graphic files in your listing output with ODS LISTING SELECT NONE; and ODS LISTING SELECT ALL;

PG
BruceBrad
Lapis Lazuli | Level 10

Puzzling.

  • ODS listing is closed. (If I use the command Ods listing select none, I get an error message 'The Listing destination is not active').
  • If I right click on the results window and choose source I get the html code for that page. Searching this, I don't find any reference to the png files that appeared in the current program directory.
BruceBrad
Lapis Lazuli | Level 10

I think I've worked out where they're coming from. I also have

ods markup tagset=ExcelXP

Even though I couldn't see in graphs in the Excel file created, it was (trying) to link to them. I'll see if tagset=Excel works better.

Thanks all for your suggestions.

Reeza
Super User

If you're in a later version of SAS, 9.4TS1M3+ you can use ODS EXCEL instead of TAGSETS which supports pictures.

BruceBrad
Lapis Lazuli | Level 10

Sorry, that's what I meant: ODS Excel (not ODS tagsets=excel). This has fixed the problem (and does a better job than tagsets=excelxp).

Thanks all.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 8 replies
  • 1877 views
  • 4 likes
  • 3 in conversation