The log just returned the following error:
ERROR: A lock is not available for CCO_AREA.CCO_PCPCH_PROV_INTERLEAVED.DATA.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 1 observations read from the data set CCO_AREA.CCO_WITH_PCPCH.
NOTE: There were 1 observations read from the data set CCO_AREA.PROV_IN_STATE_W_NPI_ADDRESS.
WARNING: The data set CCO_AREA.CCO_PCPCH_PROV_INTERLEAVED was only partially opened and will not be saved.
I have never gotten this error before.
How can it be resolved?
Thank you for your help.
wlierman
Hi Jagadishkatam,
I took your advice but rebooted and the problem was resolved.
Thanks.
wlierman
You say you work with a Windows server. How do you access that?
If your SAS server runs on Unix then this article by @Kurt_Bremser might be helpful: https://communities.sas.com/t5/SAS-Communities-Library/Avoiding-the-dreaded-quot-Dataset-is-locked-q...
For SAS tables a process writing to a table locks it and any read access will lock the table for any other process trying to write to the table.
A table gets already locked for write access if you have it open somewhere - like if you've got two SAS sessions open with the table open.
There is no "fix" for that other than the person/session/process locking the table releasing it (i.e. closing the data grid in the session, libname blah clear, restart the SAS session, ....)
For folks who find the above solutions unsatisfactory or you're wondering why LOCK LIBNAME LIST or LOCK LIBNAME QUERY is returning something to the effect of "You and nobody on your system is locking this dataset." and yet you run a PROC DATASET step and your files are still locked, you have more options.
You can check to see what files are in use by your system and terminate/kill those processes by process ID's.
For Unix Systems, you can use lsof -p | grep FILENAME which will spit out the process ID(s) using the file. You can kill that process with kill -v PROCESS_ID.
On Windows Servers, you have to install the Handle.exe program onto your compute server. Then you must open up the command prompt and run the handle.exe file and feed it the name of the table/file you are attempting to access. Which will provide the process ID(s) using the file. You open up Windows Task Manager, go to Details, sort your process IDs, and then you can kill that process.
It is highly likely this will damage the file, however, we can delete the file and replace it with SAS Data Integration Studio. Looking at the LIBNAME statement you can find where on your machine the file is and delete it. Then you use SAS Data Integration studio to recreate your corresponding library.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.