Usage Note 36803: "ERROR: A lock is not available for dsname.DATA, lock held by another process" might be received with the DATASETS procedure
The following error message might be generated when you try to delete a data set using PROC DATASETS:
ERROR: A lock is not available for dsname.DATA, lock held by another process.
The problem can occur when software external to a SAS® session is accessing your SAS data sets. These collisions can result from any number of different software programs, such as backup software or virus protection software. Some of these software packages include an option to set a file type exclusion. To avoid collisions, you should always exclude the following SAS file types and the SAS WORK location from your antivirus configuration:
- .lck
- .sd2
- .sc2
- .SPDS
- .sas*
- .utl
In Microsoft Windows environments, for example, you might have software such as Diskeeper or DiskXtender running. Some of the archival software programs wait for a new or updated file to be changed and then immediately open it in order to copy it to the archival location. When that occurs, the data becomes locked from the SAS session.
One way to determine whether other software is accessing your SAS files is to use Process Monitor, which is free downloadable software available from the Microsoft Windows Sysinternals web site.
The SAS system option FILELOCKWAIT is valid at startup and can be used to specify the number of seconds that SAS will wait for a locked file to become available.
If you are unable to obtain a lock but want to continue trying to obtain that lock for a period of time, you can use the SLEEP function to attempt a lock periodically, as shown in Sample 51275, "Locking a data set and verifying that a lock is held."
If you are using SAS® Enterprise Guide®, see Tip: How to close all data sets in SAS Enterprise Guide. Note that SAS/SHARE® software provides concurrent update access and avoids the problem of receiving this error regarding a locked data set.
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
Microsoft Windows XP Professional | 9.1 TS1M3 | |
Windows Vista | 9.1 TS1M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
"ERROR: A lock is not available for dsname.DATA, lock held by another process" might be received when you delete data sets with PROC DATASETS.
Date Modified: | 2021-11-23 15:26:38 |
Date Created: | 2009-08-10 14:11:29 |