SAS code consistently fails when running IRM_ACQUIRE_LOCK


Since SAS does not handle locks on tables in separate SAS sessions inherently (see SAS Lock documentation), Risk Stratum Core provides its own code to prevent locking issues when multiple users are trying to access the same tables. This code involves an entry in the RMCDR.MASTER_SEMPAHORE table and the creation of mutex files on the file system. If a job quits unexpectedly (such as due to a server restart, environment issue, and so on) while a lock had been reserved on a resource, those master_semaphore entries and/or mutex files might become orphaned and prevent future processes from acquiring a lock on the given resource. In this scenario, the following error appears in your SAS log.

ERROR: Could not acquire a lock on resource _________ within the specified time period (MAX_WAIT: ____ seconds)

Solution

Navigate to your SASRiskWorkGroup directory and then open the groups/Public/SASRiskManagementCore folder. Within that folder, delete any old mutex files. In SAS® Studio or any other SAS client, remove all old entries from the RMCDR.MASTER_SEMAPHORE table.

Additional background information: