BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
wlierman
Lapis Lazuli | Level 10

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

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16
This happens when the dataset you are trying to generate is already there and again you are running it to generate it but this time either you or someone else has opened it and it is unable to overwrite the opened dataset. In order to avoid this, the opened dataset has to be closed and the code for the same has to be run again.
Thanks,
Jag

View solution in original post

11 REPLIES 11
Jagadishkatam
Amethyst | Level 16
This happens when the dataset you are trying to generate is already there and again you are running it to generate it but this time either you or someone else has opened it and it is unable to overwrite the opened dataset. In order to avoid this, the opened dataset has to be closed and the code for the same has to be run again.
Thanks,
Jag
wlierman
Lapis Lazuli | Level 10

Hi Jagadishkatam,

 

I took your advice but rebooted and the problem was resolved.

 

Thanks.

 

wlierman

sustagens
Pyrite | Level 9
If you are using SAS Enterprise Guide, go to Tools > View Open Data Sets, from there you can close any of the open datasets listed.
wlierman
Lapis Lazuli | Level 10
Thanks.  I am working in a Windows environment with base SAS.
Is there a quick fix like that for SAS in Windows?
wlierman


wlierman
Lapis Lazuli | Level 10
Hello,
The SAS server is located on Windows.Thanks.
wlierman


Patrick
Opal | Level 21

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, ....)

wlierman
Lapis Lazuli | Level 10
Thanks Patrick.
bprice
Calcite | Level 5
Another cause of this error is something outside of SAS locking the file. If you are storing a large permanent SAS data set on a cloud server such as DropBox and trying to read/write to it often, the cloud service may have the file locked while it is pushing it to the cloud. For example, I've run into this when running a bootstrap routine that was trying to save iterations to a permanent data set on a cloud server and also when trying to sequentially update a large permanent data set multiple times during a SAS program. The solution is to just read/write everything locally and not save to the cloud based server until the end of the program.
gregorywpower
Calcite | Level 5

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 11 replies
  • 68798 views
  • 5 likes
  • 8 in conversation