BookmarkSubscribeRSS Feed
ply20051
Calcite | Level 5

Hello,

 

I have a very weird issue with ODS Excel. 

 

I put ODS Excel code section in front of proc sql and several proc freq. After running the program, I don't get any excel file, nothing coming out. Log doesn't say anything either.

 

Then I only marked and run the top part of "ODS Excel file=..."  code again, it gave me the excel file.

 

What is this problem? How to fix it to generate the excel file right away after the running of the program.

 

Thank you so much for your help!

 

Here is my SAS codes:

 

ods excel file="c:\....xlsx" options (...);

 

proc sql;

create table a1 as

select *

from *;

quit;

 

ods excel options(sheet_interval="proc" sheet_name="Table 1";

 

proc freq data=a1;

title1 "Table 1"

table col1;

run;

 

ods excel options(sheet_interval="proc" sheet_name="Table 2";

 

proc freq data=a1;

title1 "Table 2"

table col2;

run;

 

ods excel close;

 

 

5 REPLIES 5
Reeza
Super User

Post the log.

 


@ply20051 wrote:

Hello,

 

I have a very weird issue with ODS Excel. 

 

I put ODS Excel code section in front of proc sql and several proc freq. After running the program, I don't get any excel file, nothing coming out. Log doesn't say anything either.

 

Then I only marked and run the top part of "ODS Excel file=..."  code again, it gave me the excel file.

 

What is this problem? How to fix it to generate the excel file right away after the running of the program.

 

Thank you so much for your help!

 

Here is my SAS codes:

 

ods excel file="c:\....xlsx" options (...);

 

proc sql;

create table a1 as

select *

from *;

quit;

 

ods excel options(sheet_interval="proc" sheet_name="Table 1";

 

proc freq data=a1;

title1 "Table 1"

table col1;

run;

 

ods excel options(sheet_interval="proc" sheet_name="Table 2";

 

proc freq data=a1;

title1 "Table 2"

table col2;

run;

 

ods excel close;

 

 


 

ply20051
Calcite | Level 5

Sorry. This time it works. I run it twice and it works.

 

 

Reeza
Super User

Your code has errors so I would still suggest checking your log and fixing any issues.

ply20051
Calcite | Level 5

Got you. I will look into my log to fix the errors.

 

May I know what errors you saw?

 

Thank you so much!

ply20051
Calcite | Level 5

I forgot typing in ")" in ods options. 

 

Thank you!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2122 views
  • 0 likes
  • 2 in conversation