1

I am using SAS ODS statement to create excel files in a program like so:

ods listing close;
ods tagsets.excelxp file='filters.xls' style=statistical
  options(autofilter='2-7' frozen_headers = '3' index='yes' sheet_name='triangle' embedded_titles='yes');
  title "Accumulated Triangle Table";

proc print data=TriangleSist; run;

ods tagsets.excelxp close;
ods listing;

However, when I run this program, SAS asks me whether I want to save the excel file each time I run it with a pop-up dialog. How can I get it to stop doing that?

Joe
  • 62,789
  • 6
  • 49
  • 67
user3714330
  • 679
  • 12
  • 32
  • Why dont you use path?, like: ods tagsets.ExcelXP path='output-directory' file='MyWorkbook.xls'; and here ist a document which mentions it: http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CC4QFjAB&url=http%3A%2F%2Fsupport.sas.com%2Fresources%2Fpapers%2Fproceedings12%2F150-2012.pdf&ei=a_iTVeWTI8mdsgHZm4moBw&usg=AFQjCNGnYBw3BFB3Z1FAAY90zy5GQ989JQ&sig2=rKtOD0L8GcTMSq7lyE3UVQ&bvm=bv.96952980,d.bGg – kl78 Jul 01 '15 at 14:24
  • I've never had SAS prompt me for a path in that situation. Why not simply say file="c:\whaeer\filters.xls"? – Joe Jul 01 '15 at 14:36
  • I tried both `path="directory" file="filters.xls` and `file="directory\filters.xls"` With both options, Excel or SAS asks me if I want to open the Excel file or if I want to save it. Maybe it is an option in Excel or SAS. One good news, at least when I click the "save" button, it brings me directly to my target directory now. – user3714330 Jul 01 '15 at 14:46
  • Hm, are you changing the application header somewhere before your ods statement? – kl78 Jul 01 '15 at 14:54
  • Which header do you mean? You mean the library name? As general, I think my variables are consistent through my code. – user3714330 Jul 01 '15 at 14:57
  • I've modified the question to more clearly include that information - the comment above makes it much more clear. This has nothing to do with the "path" itself, as the answer showed. – Joe Jul 01 '15 at 16:03

1 Answers1

2

The popup would be showing in case of using PC SAS. This is happening due to certain Results setting setup on the PC SAS. Try going to Tools -> Options->Preferences -> Results tab. In the Result tab under Results options section uncheck "view results as they are generated". This should stop the popup for open/save/cancel to show up and the excel file would save on the folder location mentioned in the file= options.

sushil
  • 1,576
  • 10
  • 14