Help using Base SAS procedures

SAS 9.3 Turn html back on

Super Contributor
Posts: 268

SAS 9.3 Turn html back on

i submitted the following statement so that the default html output would clear with each procedure.  ods html newfile=proc;

Now I can't turn it back on.

Posts: 8,742

Re: SAS 9.3 Turn html back on


  I'm not sure what you want to turn back on??? You might try:

ods _all_ close;  /* closes all open destinations */

ods html;         /* reopens the cumulative HTML file with default options*/

in order to turn the cumulative HTML file back on. Or, you can close SAS, reopen SAS and make sure that the Tools-->Options-->Preferences-->Results choices are set appropriately, as described here: and here and here:

Or, you can choose what I call the "full control" method, that gives you control over the location of your output and the name of the file(s) generated, by using an ODS "sandwich" explicitly. In the first example, 2 of the procedures will have their output sent to the my_two_results.html file and the 3rd procedure will go to a different location and file named reportNov.html -- in this way, you know exactly how what output is being written and the location to which it is being written.


ods _all_ close;


ods html file='c:\temp\my_two_results.html';
proc print data=sashelp.class;


proc freq;
  tables region;
ods html close;

ods html file='q:\backup\reportNov.html';
  proc print;
ods html close;

Posts: 3,475

Re: SAS 9.3 Turn html back on

If you are trying to clear the HTML destination, here's one way to do it in SAS 9.3:

Super User
Posts: 10,483

Re: SAS 9.3 Turn html back on

If part of the issue is that restarting HTML output has files going into an "active" folder that isn't the one you want this may be of help. The first part of the code gets the location of the WORK library as a good place to put temporary files. Then the ODS HTML PATH= restarts HTML output and places the temporary HTML files in that library.

proc sql noprint;

select trim(path) into :workpath from dictionary.libnames

where libname='WORK';


%let workpath=%trim(&workpath);

ods html path="&workpath";

Super User
Posts: 9,671

Re: SAS 9.3 Turn html back on

Hi. ballardw

It could be more simple:

%let workpath=%sysfunc(pathname(work));

%put &workpath;


Super User
Posts: 10,483

Re: SAS 9.3 Turn html back on

Hadn't found the PATHNAME function. Thanks for pointing that out.

Posts: 23

Re: SAS 9.3 Turn html back on

Probably can just simplify it even more with:

ods html path="%sysfunc(pathname(WORK))";

Ask a Question
Discussion stats
  • 6 replies
  • 6 in conversation