The SAS Output Delivery System and reporting techniques

How do I keep Excel spreadsheet from opening when ODS Excel is closed

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

How do I keep Excel spreadsheet from opening when ODS Excel is closed

I am using SAS version 9.4 TS Level 1M3.  

 

I have a  snippet of code below that creates an Excel Spreadsheet with the fomatting I want however, as soon as I finish running the code Excel opens. I plan to run this in batch mode at night when I am not awake and then send a link to the created spreadsheet to a number of users. I know if I use PROC EXPORT or the Libname statement to create the XLSX file the spreadsheet  does not open, but the format is not "PRETTY". Is there anyway using ODS Excel to keep the spreadsheet from opening?

 

Thanks for any help/advice you can provide.

John

 

Code Snippet:

 

filename library 'C:\library.txt' ;
%include library;
options missing = '';
ods _ALL_ close ;


ods excel file="O:\Folder\Exception Extracts.xlsx"
options(
sheet_interval="Proc"
suppress_bylines="yes"
sheet_name='Sheet Name'
autofilter='all'
frozen_headers='on'
);


proc report data=work.low_bal;
columns field1 field2 field3 field4 field5 field6 field7 field8 field9;
define field1 / display;
define field2 /display format=8.2 style=[tagattr="format:#,####0.00"];
define field3 / display format=8.2 style=[tagattr="format:#,####0.00%"];
define field4 / display;
define field5 / display;
define field6 /display;
define field7 /display;
define field8 /display;
define field9 /display format=8.2 style=[tagattr="format:#,####0.00"];
run;
quit;
ods excel close;


Accepted Solutions
Solution
‎07-12-2017 10:05 AM
Occasional Contributor
Posts: 5

Re: How do I keep Excel spreadsheet from opening when ODS Excel is closed

Reeza thanks for the quick responce.

 

So the issue I am having will not occur when the job runs in batch mode from a scheduler. It is only happening because I am manually running the program from the enhanced editor window correct?

 

 

View solution in original post


All Replies
Super User
Posts: 17,829

Re: How do I keep Excel spreadsheet from opening when ODS Excel is closed

There's an option called 'View Results as they are generated' in Base and EG that you can turn off. This means that any output to an external file (PDF, DOC, XLSX) will no longer automatically open.

Find this option in Tools>Preferences>Results Tab

 

 

Solution
‎07-12-2017 10:05 AM
Occasional Contributor
Posts: 5

Re: How do I keep Excel spreadsheet from opening when ODS Excel is closed

Reeza thanks for the quick responce.

 

So the issue I am having will not occur when the job runs in batch mode from a scheduler. It is only happening because I am manually running the program from the enhanced editor window correct?

 

 

Super User
Posts: 17,829

Re: How do I keep Excel spreadsheet from opening when ODS Excel is closed


JohnO1 wrote:

Reeza thanks for the quick responce.

 

So the issue I am having will not occur when the job runs in batch mode from a scheduler. It is only happening because I am manually running the program from the enhanced editor window correct?

 

 


Sorry, I don't know the answer to that question. I don't run jobs from a scheduler.

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 414 views
  • 0 likes
  • 2 in conversation