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

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

 

View solution in original post

5 REPLIES 5
Shmuel
Garnet | Level 18

When you define ODS HTML precede it by filenmae like:

 

filename myhtm '...any path..any name.html';

ODS HTML file=myhtm;

 

 

Rsnead91
Fluorite | Level 6
Thank you for your suggestion.

Is there a path to the SAS WORK library that I could use?
ballardw
Super User

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.

 

Rsnead91
Fluorite | Level 6
Thank you for your suggestion.

I tried out the macro, but my files still seem to be saving in the active folder outside of SAS.
Rsnead91
Fluorite | Level 6
Nevermind! I realized that I wasn't placing the macro in the correct location in my code. It works now.

Thank you!

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3219 views
  • 2 likes
  • 3 in conversation