Hi,
Is there a way to export the SAS output into .xlsx format using ODS option? The below program is not working.
proc sort data=sashelp.class out=test;
by age;
run;
ods excel file="/sasserver/excel_conversion_file.xlsx";
proc print data=test;
run;
ods excel close;
"Not working"?
Please tell us EXACTLY what is not working. Show us the SASLOG. Give us details.
Just a guess, is that a valid file location next to FILE= ???
Yes, it's working when I use .xlsx version. File is getting created, cannot open it. Thanks for looking into it.
It says 'Excel cannot open the file because the file format or file extenstion is not valid'. However this is working fine with .xls format.
Is there a way to get the output file in .xlsx without any error?
proc sort data=sashelp.class out=test;
by age;
run;
ods tagsets.excelxp file="/sas server path/excel_conversion_file.xlsx";
proc print data=test;
run;
ods tagsets.excelxp close;
Location used in the FILE= is correct.
Is the problem happening using ODS EXCEL like in your original post, or using ODS TAGSETS.EXCELXP as in your second example?
What version of Excel do you use?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.