SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 39408: SPDE data sets unexpectedly locked or not available

DetailsHotfixAboutRate It

ERROR: The file is already locked by another user.

The trace messages revealed that the "file is already locked" message results when two or more SAS processes attempt to create a new metadata file with the same temporary name in the same SPDE library.

Explanation

When SPDE creates a new metadata file, it first creates it with a temporary, or preliminary name. If the temporary name is already in use and cannot be opened, the number being used as the file name is incremented, and SPDE tries again. Once an available file name is found, the new data set is created. When the metadata file has been populated and is closed, the file is renamed to its permanent name.

The trace messages around the error show the source of the trouble as being contention around a temporary metadata file name. The message reporting that the file is already locked by another user indicates that a file with that name already exists in the directory, and that it is open and in use.

This is a case in which improved error reporting by the IO sub-system in version 9.2 has had the unfortunate side effect of adding confusion to an otherwise successful process. This issue didn't occur in 9.1 because the IO sub-system did not report all errors encountered. It now does a better job of reporting problems. However, it is now reporting an error in a situation that in fact, is not an error, but an anticipated occurrence. When SPDE can't get access to a given temporary file name, it just changes the name and tries again, and continues doing so until it finds a name it can use.

Impact of messages

The "file is already locked" errors are harmless. The engine is attempting to open a new file, but has anticipated that the file name may already be in use, and has made provisions to keep trying if that occurs. This is a case in which failing to open a file is an acceptable outcome, and the engine simply works around the problem. The trouble is that the IO sub-system does NOT know that the failed open is acceptable, and reports an error.

Workaround

NONE, messages are not indicating an error.

Please note: SAS 9.3 and the Hotfix on SAS 9.2, reduce the frequency of the messages, but do not completely eliminate them.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemN/Az/OS9.2 TS2M09.3 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M09.3 TS1M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS2M09.3 TS1M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS2M09.3 TS1M0
Microsoft Windows XP 64-bit Edition9.2 TS2M09.3 TS1M0
Microsoft® Windows® for x649.2 TS2M09.3 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M09.3 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS2M09.3 TS1M0
Microsoft Windows Server 2003 Standard Edition9.2 TS2M09.3 TS1M0
Microsoft Windows XP Professional9.2 TS2M09.3 TS1M0
Windows Vista9.2 TS2M09.3 TS1M0
64-bit Enabled AIX9.2 TS2M09.3 TS1M0
64-bit Enabled HP-UX9.2 TS2M09.3 TS1M0
64-bit Enabled Solaris9.2 TS2M09.3 TS1M0
HP-UX9.2 TS2M09.3 TS1M0
HP-UX IPF9.2 TS2M09.3 TS1M0
Linux9.2 TS2M09.3 TS1M0
Linux for x649.2 TS2M09.3 TS1M0
Linux on Itanium9.2 TS2M09.3 TS1M0
OpenVMS on HP Integrity9.2 TS2M09.3 TS1M0
Solaris for x649.2 TS2M09.3 TS1M0
Tru64 UNIX9.2 TS2M09.3 TS1M0
* 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.