BookmarkSubscribeRSS Feed
theponcer
Quartz | Level 8
ERROR: Resource is write-locked by another thread.  File =/hpsasfin/prod/winfiles13/File.$$1.
Error creating temporary file for XLSX file -> /hpsasfin/prod/winfiles13/File.$$1 .  It is either 
       not an Excel spreadsheet or it is damaged.   Error code=80001019
Requested Output File is Invalid

Does anyone know how to get rid of this file so that I can write out to my XLSX file? This happens when I realize that I am exporting the wrong (read, WAY too big) file and stop the process in the middle. I have previously been "solving" this problem by switching the path I export to, but this has happened enough times that I want to know how to solve it so I can write to the same file. Any ideas?

4 REPLIES 4
ballardw
Super User

Can you share how you are attempting to export the data? A task, wizard, proc export code, ods destination?

Are you using Display manager, Enterprise Guide, University Edtion? and maybe the OS as well.

theponcer
Quartz | Level 8

Operating System: LIN X64 .

Current version: 9.04.01M5P091317

Using EG

 

%macro export_excel(table,path,libname,database);
%let libname = %sysfunc(coalescec(&libname,work));
%let database = %sysfunc(coalescec(&database,Excel));

PROC EXPORT  

   DATA=&libname..&table.
   DBMS=&database. REPLACE
   outfile = "&path.";
   sheet= "&table.";
RUN;
%mend;

%let export=/hpsasfin/prod/winfiles13/File.xlsx;

%export_excel(file,&export.,,XLSX);
ballardw
Super User

If you write the code directly without any of the macro stuff do you get the same error?

 

Is /hpsasfin a root of a drive? Any path that does not start with defined root (drive or mount point etc. OS dependent) gets treated as a relative path and can cause some odd errors depending on operating system and how each treats the relative path.

 

And are you running with a SAS server that is actually executing on a different machine? Seriously goes to path issues and permissions.

 

ErikLund_Jensen
Rhodochrosite | Level 12

My guess would be that is has nothing to do with the file path or your way of exporting, but is what it says - a process is still holding the file,

 

Does it also happen if you close your EG session and start another? That should close your workspace-server session, but it happens now and then (at least to us) that an orphaned process is left running and holds a file forever, and then you need a system programmer to identify it and kill it. We recently had a situation where we had to reboot the cluster to get a file freed.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 10192 views
  • 1 like
  • 3 in conversation