Help using Base SAS procedures

ods html;

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

ods html;

This statement causes SAS to create html file in the directory of the sas code file, but default is only to view the output in SAS windowing environment. Does anyone know how to restore the default without closing SAS and reopening it? What option should I add to the statement? I just want to view the output in SAS windowing environment but no output html  file.


Accepted Solutions
Solution
‎07-06-2016 10:44 PM
SAS Super FREQ
Posts: 8,740

Re: ods html;

What you see in the Results Viewer is ALWAYS a local file. The issue is that WORK goes away when you close SAS and so it doesn't seem "LOCAL". In the Tools--> Options --> Preferences --> Results window, there is also a checkbox to open the file as soon as it is created. If this is "ON" or checked, then your file will automatically open in the Results Viewer. If this box is "OFF" or unchecked, then you have to double click in the Results Viewer to see the file. It is this checkbox that controls when the file "pops open" or not.

When I work, because I so often create several outputs (because I am comparing the HTML results to the RTF and/or PDF results), I always turn that button OFF, so I can double click to see the output I want. It makes me crazy to have the HTML pop open, then the RTF pop open and then the PDF pop open -- so I just click on what's in the Results Viewer.

Everybody works differently. Your output is either in WORK or it is in your default working storage location (possibly something like c:\users\xxxyyy\My Documents\My SAS Files\ -- the advantage of having the output in WORK is that it goes away and you don't have to clean up the other location. I am a "full control" person however, so I actually turn off everything in the "automatic" creation department and I use ODS HTML with FILE= about 95% of the time.

When we first transitioned from "always LISTING" to "always HTML" in SAS 9.3, I wrote this paper...it shows the code method for much of what you want to do, but the minute you issue an ODS _ALL_ CLOSE; or an ODS HTML CLOSE or an ODS HTML; in your code, then you are changing how the defaults work.

This may help you: https://support.sas.com/resources/papers/proceedings12/250-2012.pdf

Keep in mind that there are some differences between the behavior in SAS 9.3 and SAS 9.4. Notably, in SAS 9.4 there is now a working DELETE button for the Results Window, which is wonderful - -because it clears the cumulative file that was being created. I still prefer the "full control" method that I show in the paper, but perhaps it will help you.

cynthia

View solution in original post


All Replies
SAS Super FREQ
Posts: 8,740

Re: ods html;

Hi:
ODS HTML should allow you to see the file in the Results Viewer, but the name will be some default name. I am not sure what you mean by "restore the default". Try going to
Tools --> Options --> Preferences --> Results tab and make sure that listing is off and then make sure that "Create HTML" is checked and that WORK (as the location) is also checked. And then, this should restore your output creation to the default set for SAS.

You can use ODS HTML, but with a path= like this:
ods html path="%sysfunc(pathname(WORK))";

should have the same end result as using the Tools --> Options --> Preferences path in the Display Manager interface.

cynthia
New Contributor
Posts: 2

Re: ods html;

Hi,

 

Thanks for the reply. By "restore the default", I mean that SAS will only create an output in the Results Viewer, but no local file will be created. However, if you do write:

ods html;

SAS wll not only allow you to see the file in the Results Viewer, but also create a local file which I do not need. I don't know what option I should add to avoid a local html file being created.

 

I know by doing "Tools --> Options --> Preferences --> Results tab and make sure that listing is off and then make sure that "Create HTML" is checked and that WORK (as the location) is also checked.", I can restore the default, but I don't know how to write code to achieve that. It seems that there is always local html file being created. Do you know what option should be used to avoid a local html file being created?

Solution
‎07-06-2016 10:44 PM
SAS Super FREQ
Posts: 8,740

Re: ods html;

What you see in the Results Viewer is ALWAYS a local file. The issue is that WORK goes away when you close SAS and so it doesn't seem "LOCAL". In the Tools--> Options --> Preferences --> Results window, there is also a checkbox to open the file as soon as it is created. If this is "ON" or checked, then your file will automatically open in the Results Viewer. If this box is "OFF" or unchecked, then you have to double click in the Results Viewer to see the file. It is this checkbox that controls when the file "pops open" or not.

When I work, because I so often create several outputs (because I am comparing the HTML results to the RTF and/or PDF results), I always turn that button OFF, so I can double click to see the output I want. It makes me crazy to have the HTML pop open, then the RTF pop open and then the PDF pop open -- so I just click on what's in the Results Viewer.

Everybody works differently. Your output is either in WORK or it is in your default working storage location (possibly something like c:\users\xxxyyy\My Documents\My SAS Files\ -- the advantage of having the output in WORK is that it goes away and you don't have to clean up the other location. I am a "full control" person however, so I actually turn off everything in the "automatic" creation department and I use ODS HTML with FILE= about 95% of the time.

When we first transitioned from "always LISTING" to "always HTML" in SAS 9.3, I wrote this paper...it shows the code method for much of what you want to do, but the minute you issue an ODS _ALL_ CLOSE; or an ODS HTML CLOSE or an ODS HTML; in your code, then you are changing how the defaults work.

This may help you: https://support.sas.com/resources/papers/proceedings12/250-2012.pdf

Keep in mind that there are some differences between the behavior in SAS 9.3 and SAS 9.4. Notably, in SAS 9.4 there is now a working DELETE button for the Results Window, which is wonderful - -because it clears the cumulative file that was being created. I still prefer the "full control" method that I show in the paper, but perhaps it will help you.

cynthia
☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 299 views
  • 1 like
  • 2 in conversation