BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dmarques1998
Obsidian | Level 7

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@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.

 

View solution in original post

5 REPLIES 5
Reeza
Super User
Show the log.
ballardw
Super User

@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
Obsidian | Level 7
Have reupload with the log.
ballardw
Super User

@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.

 

Reeza
Super User
SAS thinks that something has the Excel file locked and can't overwrite it. Try writing it to a different file name and see what happens.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 8652 views
  • 7 likes
  • 3 in conversation