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)
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.