I don't want this window to open, but I can't seem to disable it while still having my ODS HTML outputs generate their spreadsheets..... Help!
You can turn off the ods listing destination by using
ods listing off;
before running your code.
You can also check a box in options that says do not view results as they are generated.
Analyze this sequence
proc print data=sashelp.class;run;
ods html close;
ods preferences;
ods results=off;
ods listing;
proc print data=sashelp.class;run;
ods html path="%sysfunc(pathname (WORK) ) ";
ods results=on;
proc print data=sashelp.class;run;
ods html close;
ods results=off;
ods html file="d:\pseudoexcel.xls" style=minimal;
proc print data=sashelp.class;run;
ods html close;
ods results=on;
Andre,
Running that code I get the results viewer window, but no excel output.
Preferences - Results options do not seem to give me the opposite with any combination.
I want No results viewer, output only to excel.
I run the ODS once and get this kind of error:
ERROR: A component of C:\SAS\Work\_TD5324_PC2UA2120QB8_\G:\REPORTS\fakename.xls is not a directory.
ERROR: No body file. HTML output will not be created.
If I run it again, then I get no error. WTF 9.3?
Andre's code demonstrates how to turn the output on and off. If you go through it step by step you should be able to determine the settings you need.
For example, your results view has 2 proc prints, but 3 were submitted.
I'm running exactly the same code I was in 9.2, so it's not the code. It's something with the new system options that I need reset.
Hi:
The Results Viewer is part of SAS. To turn off the "automatic" HTML that's created in the 9.3 Windowing Environment, you need to follow the Tools--> Options --> Preferences --> Results path from the menu and change your options. Or you have to issue code (as Andre suggested). If you ALWAYS want your output to go to Excel (via ODS), then you have to take "full control" of the ODS statements, as described in this paper.
http://support.sas.com/resources/papers/proceedings12/250-2012.pdf (choice #3)
In addition to using the "full control" method, you might also want to change your options to turn off the automatic HTML creation just to make your life easier. The Results Viewer only comes into play when HTML is turned on automatically. The Results Viewer window is merely giving you a way inside SAS to navigate to the output files you've created.
cynthia
If I disable Create HTML in the preferences,I get my excel output, results viewer still opens.
try ods noresults; before your code.
This worked well !!! thanks.
This worked for me as well. Thank you!
wcpatton,
Read now my comment of the code: the comments of Reeza and Cynthia are welcome.
* now with comments and one apologize about the implicit context;
* i was supposing you were with those implit rules
ods graphics on / results drected to the internal browser/ods html 9.3 by default;
proc print data=sashelp.class;run;
* appearing in the results viwer as html;
ods html close;
*closing html so that perhaps you want another ods destination;
ods preferences;
* to be free to restart eventually the ods html in order to produce
another html file;
ods results=off;
* now you said no results viewer : in consequence i close the results viewer;
* and you have the possibility to produce listing text results in the OUTPUT windows
which is different from the results viewer;
ods listing;
proc print data=sashelp.class;run;
*you see it in the output windows!;
ods html path="%sysfunc(pathname (WORK) ) ";
* this is the only way to restart producing in the implicit
destination html under 9.3 in the work so that at the end you
don't have to delete all the attemps html+png you may have produced
as try... ;
* but;
ods results=on;
* you have to open results again to permit the results viwer to work again;
proc print data=sashelp.class;run;
* you have seen a new results in html (a new file in the work) in the results viewer;
ods html close;
* closing again the results viewer in order to only produce a xls file
that will not open in the results viewer through the ods html xls suffix trick;
ods results=off;
*therefor as my/yours? implicit setting is opening inside the internal viewer
i need to close the results to SILENT producie thepseudo xls file avoiding
the opening of the internal results viewer!;
ods html file="d:\pseudoexcel.xls" style=minimal;
proc print data=sashelp.class;run;
ods html close;
* did you see something no!;
*but you have your excel file;
* if your settings (see Cynthia answer) were opening with firefox or IE
and not in the results viewer , all that behavior would appear different
and the explained logic have to be changed;
ods results on;
* turn now the results on again to work again normally
and open your desired destination : attention as i don't have close listing it is yet open
like in 9.2.3;
/*
for me
ods results on; ods noresults ;
are the same as ods results=on; ods results=off;
UNTIL ANYBODY PROOF ME A SUBTLE DIFFERENCE ;
*/
Andre
I have this same issue. No code change. Run once, get the error. Resubmit, runs fine.
wcpatton wrote:
Andre,
Running that code I get the results viewer window, but no excel output.
Preferences - Results options do not seem to give me the opposite with any combination.
I want No results viewer, output only to excel.
I run the ODS once and get this kind of error:
ERROR: A component of C:\SAS\Work\_TD5324_PC2UA2120QB8_\G:\REPORTS\fakename.xls is not a directory.
ERROR: No body file. HTML output will not be created.
If I run it again, then I get no error. WTF 9.3?
NOTE: AUTOEXEC processing completed.
1 ods html file="L:\SAS Projects\Check 201503.xls";
NOTE: Writing HTML Body file: L:\SAS Projects\Check 201503.xls
ERROR: A component of C:\Users\1\AppData\Local\Temp\SAS Temporary
Files\_TD9600_1_\L:\SAS Projects\Check 201503.xls is not a directory.
ERROR: No body file. HTML output will not be created.
2 ods html file="L:\SAS Projects\Check 201503.xls";
NOTE: Writing HTML Body file: L:\SAS Projects\Check 201503.xls
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.