Hello SAS Community!
My SAS program seems to always save my html output to the folder outside of SAS which contains my program. Over time these html files accumulate and become a nuisance, overcrowding my folders. I would really like to stop SAS from exporting these html files, while keeping my ability to view the html results in SAS as I am running my procedures.
Currently, I use the following code to clear out my html output files:
ODS HTML CLOSE; ODS HTML;
I think this may have inadvertantly caused the issue. I can go into my results preferences and paste a destination path for the output to be sent to, however, I don't want to have to do that everytime I open SAS. I would prefer to just use some code that prevents SAS from exporting the files. Any help would be greatly appreciated!
Thanks!
Ryan
Since you are closing and then reopening the ODS HTML without a PATH option it sends the output to someplace active in the session and defaulting to the place your are working.
So you may want to specify a PATH for output that you like.
I have a macro that resets the ods path to the work library so it can get cleaned up:
%macro resetHtml; %let workpath= %sysfunc(getoption (work)); ods html path="&workpath" newfile=proc; %mend;
So I can use %resethtml; in code to send output there when reopening the HTML destination.
When you define ODS HTML precede it by filenmae like:
filename myhtm '...any path..any name.html';
ODS HTML file=myhtm;
Since you are closing and then reopening the ODS HTML without a PATH option it sends the output to someplace active in the session and defaulting to the place your are working.
So you may want to specify a PATH for output that you like.
I have a macro that resets the ods path to the work library so it can get cleaned up:
%macro resetHtml; %let workpath= %sysfunc(getoption (work)); ods html path="&workpath" newfile=proc; %mend;
So I can use %resethtml; in code to send output there when reopening the HTML destination.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.