- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your %LET statement misses a terminating semicolon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please post the log again. Run the %LET, the LIBNAME and the DATA step all at once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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)