Hello,
I am attempting to export data to an excel workbook. However, I am getting an error message in the log that the XLSX file cannot be created. Please help.
Here is the code I am using:
libname xlout xlsx "&outpath/southpacific.xlsx";
data xlout.South_Pacific;
set pg1.storm_final;
where Basin="SP";
run;
proc means data=pg1.storm_final noprint maxdec=1;
where Basin="SP";
var MaxWindKM;
class Season;
ways 1;
output out=xlout.Season_Stats n=Count mean=AvgMaxWindKM max=StrongestWindKM;
run;
libname xlout clear;
Here is the log:
Thanks! I fixed that but the code still isn't running correctly. The log still takes that the temporary file for XLSX file can not be created.
Your %LET statement misses a terminating semicolon.
Thanks! I fixed that but the code still isn't running correctly. The log still takes that the temporary file for XLSX file can not be created.
Please post the log again. Run the %LET, the LIBNAME and the DATA step all at once.
I see this in the log "/home/u61133731/", which tells me you are using SAS Ondemand for Academics:
Your macro variable, outpath should be something like:
%let outpath = /home/u61133731;
if you want to create your excel directly in the Files(home) directory,
Or if you have folders under Files(home) like EPG1V2/output it would look like:
%let outpath = /home/u61133731/EPG1V2/output;
or
%let outpath = ~/EPG1V2/output;
(hint - you can use ~ to point to your user home directory)
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 16. Read more here about why you should contribute and what is in it for you!
Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.
Find more tutorials on the SAS Users YouTube channel.