Help using Base SAS procedures


Posts: 1


I have a library created on my network directory, and in it is a SAS dataset called Data3. My directory folder now contains Data3 and Data3.sas7bdat.lck. I cannot delete either file. When I try to re-run the SAS code that creates Data3, I cannot re-write the dataset in the library. SAS errors out that I do not have the proper authorization level to overwrite the changes. My company does not have authorization levels in our SAS environment. What can I do to fix either remove the files or overwrite them? Thanks!
Respected Advisor
Posts: 3,890

Re: sas7bdat.lck

The suffix lck of Data3.sas7bdat.lck exists while a data set gets created by SAS. (..this part deleted based on correct input from Daniel Santos...).

As Data3.sas7bdat.lck exisist and you can't delete it I can think of 3 possibilities:

You or someone else has a second SAS session open which is re-creating this SAS file "right now". Close this session or wait until it ends.

You have somewhere a hanging SAS process on the server which locks the datasets (i.e. killed SAS EG session on local PC with now orphaned SAS server session hanging on this datastep).

The SAS process which created the two files runs under a different user than the one you're using now trying to delete the files. Check who owns the files.

For cases B and C:
There must be someone within your organisation\SAS environment with the role of SAS administrator. Have this person look into the issue. You yourself most likely lack the necessary permissions to resolve the issue.
In case you're using server "local": Use task manager and look for a sas process (sas.exe) and kill this process or: restart your PC.


Message was edited by: Patrick Amendments as I agree with what Daniel wrote.

Message was edited by: Patrick
Super Contributor
Posts: 474

Re: sas7bdat.lck

Hello Patrick.

From what I've seen, the .lck file is pretty much independent of the library. I mean the lock file is always created on the same library that holds/will hold the final datastep. Hence at end of the process the older table gets deleted and the lck file renamed, there is no additional I/O involved such has file copying from here to there.

Cheers from Portugal.

Daniel Santos @
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation