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;
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).
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;
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;
Puzzling.
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.
If you're in a later version of SAS, 9.4TS1M3+ you can use ODS EXCEL instead of TAGSETS which supports pictures.
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.