Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODS CSV CLOSE without File Download Dialog 1

Status
Not open for further replies.

jdrb

Technical User
Jan 23, 2008
1
US
Hi. I'm controlling SAS using OLE Automation (from VB) and need to write ODS output to a csv file. This is working fine, but when I finally submit "ODS CSV CLOSE;", a File Download dialog appears asking if I want to open or save the file. Can I suppress this dialog? It appears even though I'm running a hidden instance of SAS. Thanks in advance for any thoughts. JDRB.
 
Try turn the 'view results as generated' setting off on the machine that your automatic script runs SAS.

in SAS v8
got to Tools-->Options-->Preferences and select the 'Results' tab.

Then uncheck the 'view results as generated' box in the view results section.

Hope this helps you.
Klaz
 
Hi,

Is there a way of doing this in the code?

I have a report that outputs about 1000+ HTML pages, which i want to dissable the "view output as generated".

But when im writing new scripts, i want to view the output. So would be easier to just put some code at top of report to dissable the view as generated, and then some code to turn it back on at the end of the script..

Any Ideas?

Thanks

Robbie
 
Yes there is a way. You need to modify the SAS registry. I did this a while back and will have to find the code. The basic idea, if I recall correctly, is to use the PROC REGISTRY routine and update the section titled ODS\GUI\RESULTS.
EX
Code:
[ODS\GUI\RESULTS]
"Auto Navigate"="On"
"Internal Browser"="On"

The default is
Code:
"Auto Navigate"="On"

You need to set this to "Off" like this
Code:
[ODS\GUI\RESULTS]
"Auto Navigate"="Off"

Also, I saved the original registry file (programmatically) before I modified it and was able to quickly reset it back to its original state.

You will have to look up the exact code as I can't seem to find the source right now.

Hope this sends you in the right direction.

Klaz
 
OK I just tried this and it works.

First you should save the current registry file. (I output the whole thing to a text file.)
Code:
filename t 'c:\regist.txt';
filename z 'c:\reg2.txt';

*** OUTPUT THE REGISTRY TO TEXT FILE ***;
proc registry export=t;
run;

*** WRITE NEW PREF DATA ***;
data _null_;
file z;
put "[ODS\GUI\RESULTS]";
put '"Auto Navigate"="Off"';
run;

*** IMPORT NEW OPTION ***;
*** SAS WILL ONLY UPDATE THE TAG IT FINDS ***;
proc registry import=z;
run;

*** FORCE SAS TO 'SEE' THE NEW PREFS ***;
ods preferences;


When your program is done it could reset the registry like this.
Code:
proc registry import=t;
run;

ods preferences;

I hope that this helps you.
Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top