BookmarkSubscribeRSS Feed
wcpatton
Calcite | Level 5

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!

15 REPLIES 15
Reeza
Super User

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.

Andre
Obsidian | Level 7

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;

wcpatton
Calcite | Level 5

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?

Reeza
Super User

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.

wcpatton
Calcite | Level 5

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.

Cynthia_sas
SAS Super FREQ

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

wcpatton
Calcite | Level 5

If I disable Create HTML in the preferences,I get my excel output, results viewer still opens.

DrAbhijeetSafai
Pyrite | Level 9
Use of Tools--> Options --> Preferences --> Results --> Uncheking the box of Create HTML really works! 🙂
Dr. Abhijeet Safai
Associate Data Analyst
Actu-Real
Reeza
Super User

try ods noresults; before your code. 

imanojkumar1
Quartz | Level 8

This worked well !!! thanks.

MdeCuypere
Calcite | Level 5

This worked for me as well.  Thank you!

Andre
Obsidian | Level 7

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

bpowell
Obsidian | Level 7

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?

bpowell
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 14614 views
  • 5 likes
  • 8 in conversation