The SAS Output Delivery System and reporting techniques

ODS HTML saving to folder outside of SAS without telling it to.

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

ODS HTML saving to folder outside of SAS without telling it to.

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


Accepted Solutions
Solution
‎01-24-2017 04:31 PM
Grand Advisor
Posts: 10,210

Re: ODS HTML saving to folder outside of SAS without telling it to.

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


All Replies
Super User
Posts: 1,230

Re: ODS HTML saving to folder outside of SAS without telling it to.

When you define ODS HTML precede it by filenmae like:

 

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

ODS HTML file=myhtm;

 

 

Occasional Contributor
Posts: 8

Re: ODS HTML saving to folder outside of SAS without telling it to.

Thank you for your suggestion.

Is there a path to the SAS WORK library that I could use?
Solution
‎01-24-2017 04:31 PM
Grand Advisor
Posts: 10,210

Re: ODS HTML saving to folder outside of SAS without telling it to.

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.

 

Occasional Contributor
Posts: 8

Re: ODS HTML saving to folder outside of SAS without telling it to.

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.
Occasional Contributor
Posts: 8

Re: ODS HTML saving to folder outside of SAS without telling it to.

Nevermind! I realized that I wasn't placing the macro in the correct location in my code. It works now.

Thank you!
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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