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)
SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.
Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.