Help using Base SAS procedures

SAS 9.3 Turn html back on

Reply
Super Contributor
Posts: 279

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.

SAS Super FREQ
Posts: 8,868

Re: SAS 9.3 Turn html back on

Hi:

  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: http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#p0sq3tdxedxfd1n1w8... and here

http://support.sas.com/kb/43/911.html and here: http://support.sas.com/kb/23/657.html

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.

cynthia

ods _all_ close;

 

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

      

proc freq data=sashelp.shoes;
  tables region;
run;
ods html close;


ods html file='q:\backup\reportNov.html';
  proc print data=sashelp.shoes;
  run;
ods html close;

SAS Super FREQ
Posts: 3,755

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: http://blogs.sas.com/content/iml/2011/08/29/how-to-clear-the-output-window-in-sas-9-3/

Super User
Posts: 11,343

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';

quit;

%let workpath=%trim(&workpath);

ods html path="&workpath";

Super User
Posts: 10,044

Re: SAS 9.3 Turn html back on

Hi. ballardw

It could be more simple:

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

%put &workpath;

Ksharp

Super User
Posts: 11,343

Re: SAS 9.3 Turn html back on

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

Contributor
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
  • 348 views
  • 0 likes
  • 6 in conversation