Problem Note 40876: "ERROR: A lock is not available for <libref>.RD_ENVIRONMENT_LIBREF.DATA." message occurs when spawning a risk analysis project
When you split a risk analysis project and spawn its execution across multiple processors, you might encounter error messages like the following:
ERROR: A lock is not available for <libref>.RD_ENVIRONMENT_LIBREF.DATA.
ERROR: Lock held by process XXXXX.
where <libref> is a SAS library name and XXXXX is a system process number.
These errors occur when multiple processes attempt to access the same files simultaneously. The Rd_environment_libref data set is stored in the same directory as the risk environment catalog file. When multiple risk analysis projects that are part of the same risk environment are run in parallel, the above lock error can occur when more than one parallel process attempts to update the same Rd_environment_libref file at the same time.
The workaround is to store a risk environment in a separate file directory for each spawned process that uses that risk environment. You can achieve this by using the NEW= and INHERIT= options in the ENVIRONMENT statement of PROC RISK to copy the risk environment into a new library for each spawned job.
The %RDCSPAWN macro that is provided with SAS® Risk Dimensions® 5.2 contains an example of distributed processing code that can be modified to avoid the above lock error. Line 380 of the %RDCSPAWN macro contains the following SAS code:
...
environment open=&rem_envLibname..&rem_env;
...
When executed as is, each spawned process accesses the "&rem_env" risk environment files that are located in the "&rem_envLibname" library. This could result in the lock error that is noted above.
If you modify Line 380 so that it instead contains the following line of SAS code, then the "&rem_env" risk environment files are stored in a separate library for each spawned process and the above lock error is circumvented:
...
environment new=work.spawn&REM_JOBNUM
inherit=&rem_envLibname..&rem_env;
...
Operating System and Release Information
| SAS System | SAS Risk Dimensions Enterprise Edition | Microsoft® Windows® for x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows Server 2003 Datacenter Edition | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows Server 2003 Enterprise Edition | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows Server 2003 Standard Edition | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows Server 2003 for x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows Server 2008 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows Server 2008 for x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Microsoft Windows XP Professional | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Enterprise 32 bit | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Enterprise x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Home Premium 32 bit | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Home Premium x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Professional 32 bit | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Professional x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Ultimate 32 bit | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows 7 Ultimate x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows Vista | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Windows Vista for x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| 64-bit Enabled AIX | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| 64-bit Enabled HP-UX | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| 64-bit Enabled Solaris | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| HP-UX IPF | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Linux | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Linux for x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
| Solaris for x64 | 5.2 | 5.3 | 9.2 TS2M2 | 9.2 TS2M3 |
*
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.
| Type: | Problem Note |
| Priority: | medium |
| Date Modified: | 2011-01-25 17:14:44 |
| Date Created: | 2010-09-13 12:28:30 |