Hi,
I'm trying to export SAS dataset to an excel file. However, when I run the code, Sas only create this type of file "$$1" and not a excel file.
Here is the code:
PROC SORT DATA= Data; BY Y; RUN;
PROC MEANS DATA= Data;
VAR X;
BY Y;
OUTPUT OUT= Y SUM=;
RUN;
proc export data=Data
outfile= "xxxxxx/DATA.xlsx"
dbms=xlsx replace;
sheet='Y';
run;
and here is the log:
ERROR: Resource is write-locked by another thread. File =/xxxxxx//Y.$$1. Error creating temporary file for XLSX file -> /xxxxxxx/Y.$$1 . It is either not an Excel spreadsheet or it is damaged. Error code=80001019 Requested Output File is Invalid ERROR: Export unsuccessful. See SAS Log for details. NOTE: The SAS System stopped processing this step because of errors.
Thank you
@dmarques1998 wrote:
Have reupload with the log.
Failure to follow instructions: the "log" does not show any of the code. It should start with the Proc statement.
The bit posted does show that something else is likely using your file. Possibly a previous failed attempt to write, or opening the file, or possibly even an operating system error message window is open somewhere. So you need to find which program, and if this is on a file system where other's may have access to the file which user, and get that process stopped.
ERROR: Resource is write-locked by another thread. File =/xxxxxx//Y.$$1. Error creating temporary file for XLSX file -> /xxxxxxx/Y.$$1 . It is either not an Excel spreadsheet or it is damaged. Error code=80001019 Requested Output File is Invalid ERROR: Export unsuccessful. See SAS Log for details. NOTE: The SAS System stopped processing this step because of errors.
@dmarques1998 wrote:
Hi,
I'm trying to export SAS dataset to an excel file. However, when I run the code, Sas only create this type of file "$$1" and not a excel file.
/*STA*/ PROC SORT DATA= Data; BY Y; RUN; PROC MEANS DATA= Data; VAR X; BY Y; OUTPUT OUT= Y SUM=; RUN; proc export data=Data outfile= "xxxxxx/DATA.xlsx" dbms=xlsx replace; sheet='Y'; run;
Thank you
What does your LOG show for the Proc Export? Copy the text from the LOG starting with the "Proc Export" and include all of the notes and messages. On the forum open a text box and paste the log.
Generally things like "$$1" indicate at some point the file system is having an issue of some sort and usually has something in the log.
@dmarques1998 wrote:
Have reupload with the log.
Failure to follow instructions: the "log" does not show any of the code. It should start with the Proc statement.
The bit posted does show that something else is likely using your file. Possibly a previous failed attempt to write, or opening the file, or possibly even an operating system error message window is open somewhere. So you need to find which program, and if this is on a file system where other's may have access to the file which user, and get that process stopped.
ERROR: Resource is write-locked by another thread. File =/xxxxxx//Y.$$1. Error creating temporary file for XLSX file -> /xxxxxxx/Y.$$1 . It is either not an Excel spreadsheet or it is damaged. Error code=80001019 Requested Output File is Invalid ERROR: Export unsuccessful. See SAS Log for details. NOTE: The SAS System stopped processing this step because of errors.
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.