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 InvalidDoes 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?
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.
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);
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.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.