BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jerry898969
Pyrite | Level 9

Hello,

I have a process that I move some of my sas tables to different directories for my users.   When one of the users has a table open I get the following error:

ERROR: A lock is not available for LibTest.TestData.DATA.

ERROR: Download function terminated. The file created may be unusable.

How can I have it tell me which user has the table lock?  I don't want to email every user when this happens.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
jakarman
Barite | Level 11

That one could be even your alter you on the same machine.  Than you do not have anything on the involved user name.

If you would open a txt-file in windows in notepad you will see other people can open that and update without being notified. Windows is not designed for multi-user processing it was added in the meantime.

Going for mainframes you will have to master the locking/sharing approach as that one is designed for multi-user by design. The disp=shr new/old needed for every dataset with associated enques.

In the system log you can find the information of the process giving the information who is the guilty one.

With Unix it is not that advanced as mainframe and not that left open as Windows.

What SAS I doing is using a own locking approach on sas-datasets. You can often see the -.lck suffix. When ready  the old dataset is deleted and the -.lck dataset is renamed to the original one.

When that renaming is failed that can be seen as a lock. Try the rename the file with Windows for hope it will give you a Windows message who dun it.

Also on Windows every file is associated to an owner-id completely the same as on Unix. The common security approach is hiding that setting global access rules.

All is moved to admin roles also seeing open files/sessions Manage Sessions and Open Files (Microsoft.com)

At Unix the lock message I have seeing come along with a process-number. That is belonging to a person with a task.

     
    

---->-- ja karman --<-----

View solution in original post

6 REPLIES 6
SASKiwi
PROC Star

What operating system does your SAS run under? There is no functionality in Base SAS for this so you would have to use operating system commands if available at all. One approach might be to look at the available SAS processes running and kill the process you think is locking the dataset.

jerry898969
Pyrite | Level 9

SASKiwi,

Thank you for the response.  The computer I'm testing with is running Windows 7 64-bit.

jakarman
Barite | Level 11

How do you find the user that has locked a excel-file using excel?

---->-- ja karman --<-----
jerry898969
Pyrite | Level 9

Japp,

When I open the excel file it tells me which user has the lock. 

jakarman
Barite | Level 11

That one could be even your alter you on the same machine.  Than you do not have anything on the involved user name.

If you would open a txt-file in windows in notepad you will see other people can open that and update without being notified. Windows is not designed for multi-user processing it was added in the meantime.

Going for mainframes you will have to master the locking/sharing approach as that one is designed for multi-user by design. The disp=shr new/old needed for every dataset with associated enques.

In the system log you can find the information of the process giving the information who is the guilty one.

With Unix it is not that advanced as mainframe and not that left open as Windows.

What SAS I doing is using a own locking approach on sas-datasets. You can often see the -.lck suffix. When ready  the old dataset is deleted and the -.lck dataset is renamed to the original one.

When that renaming is failed that can be seen as a lock. Try the rename the file with Windows for hope it will give you a Windows message who dun it.

Also on Windows every file is associated to an owner-id completely the same as on Unix. The common security approach is hiding that setting global access rules.

All is moved to admin roles also seeing open files/sessions Manage Sessions and Open Files (Microsoft.com)

At Unix the lock message I have seeing come along with a process-number. That is belonging to a person with a task.

     
    

---->-- ja karman --<-----
jerry898969
Pyrite | Level 9

Thank you so much Jaap for your help.

This has put me in the right direction.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 10456 views
  • 0 likes
  • 3 in conversation