Fixing "A lock is not available" on Work (SAS)

I'm working with a complex set of SAS algorithms, created by a group outside of my company, to prepare a report required each year. Unfortunately, I am running into a file lock problem:

ERROR: A lock is not available for WORK._TEMP_OP_OTHER.DATA

I did have a similar issue last year, but it then appeared to be a somewhat random problem that cropped up (rarely) during execution. I reviewed the logs to see if the problem occurred, and if so cleaned up the output files and ran the algorithm again.

This year's report is consistently producing the error in the same place every time I run the algorithm. I have tried a couple of things to give the system more time in the hopes that the lock will become available: inserting a SLEEP command and also setting FILELOCKWAIT=n in libname statements. Neither has worked as I'd hoped.

FILELOCKWAIT seems like the most promising option, but when observing the execution of the algorithm and reviewing the logs it's clear that the process is failing immediately at that section, consistent with the default FILELOCKWAIT value of 0 seconds.

I am far from an expert in SAS, but I am wondering if I need to set FILELOCKWAIT for WORK, as that is where the lock issue is coming up. Is there a way to do this, and might it help my problem? If not, are there other options I could look into?

(Note: I am aware of the TRYLOCK macro, but want to introduce as few changes as possible to the algorithms I'm running. As mentioned above, they are complex and I am concerned about introducing unintended problems which may be difficult to notice, diagnose, and fix).

10 Related questions 5 For a SAS dataset, what is the best way to prevent locking for multiple user access 0 " ERROR: . " what does it mean? 0 How do you handle deadlocks using Proc Discrim in SAS for KNN? Related questions 5 For a SAS dataset, what is the best way to prevent locking for multiple user access 0 " ERROR: . " what does it mean? 0 How do you handle deadlocks using Proc Discrim in SAS for KNN? 1 SAS workspace server terminates unexpectantly 3 " errors in SAS?">How do I stop "A lock is not available for <dataset>" errors in SAS? 3 SAS: "ERROR: Rename of temporary member for WORK.XXXX.DATA failed" 0 SAS EG: SAS Dataset is locked by opening it from EG. Need a resolution 2 A lock is not available for MYLIB.SASMACR.CATALOG 0 Finding PID responsible for "ERROR: A lock is not available for" 1 SAS EG - Check if lock is possible, else use other table Load 7 more related questions Show fewer related questions Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like