DATA Step, Macro, Functions and more

sasmstore locked, only one user can access at a time

Reply
Contributor
Posts: 22

sasmstore locked, only one user can access at a time

[ Edited ]

Hello, I've created a macro that I can store globally on a linux server defined as follows;

 

 

options mstored sasmstore = macrolib;
libname macrolib '/sas_data/macrolib';

%macro test() / store;
  macro code...
%mend;

 

I can then call the macro in another EG session to execute the macro. 

 

%test();

Running...

 

Then if I open a further session I get

 

%test();

ERROR: A lock is not available for MACROLIB.SASMACR.CATALOG.

ERROR: Lock held by process 23669.

 

Is there a way to release the lock after the macro has been called but before if finishes executing?

PROC Star
Posts: 2,311

Re: sasmstore locked, only one user can access at a time

 

You might want to contact tech support.

It works fine for me.

What I tested:

 

1st EG session, run this and disconnect server:

 

options mstored sasmstore = MACROLIB;
libname MACROLIB 'c:\temp';

%macro test() / store;  
  data _null_; call sleep(5,1); run;
  %put --------done------------;
%mend;

 

 

2 other EG sessions, run this concurrently:

 

options mstored sasmstore = MACROLIB;
libname MACROLIB 'c:\temp';
%test;

 

 

 

 

 

 

 

 

Super User
Super User
Posts: 7,932

Re: sasmstore locked, only one user can access at a time

You shouldn't need a lock to use the macro.  Are you trying to write new macros to the catalog from two different machines at the same time? Why?

Also why are you using macro catalogs instead of just using autocall macros?

Contributor
Posts: 22

Re: sasmstore locked, only one user can access at a time

[ Edited ]

I'm attempting to utilise parallel processing in EG; it would seem whenever a new process is created, effectively a new session is created with a new work. So any macros defined earlier in the project will not be auto called. 

 

In my project flow I have program that defines a macro then forks out to several programs which call that macro. Later in the process I define another macro and then call it multiple times in the same way. 

 

My issue is that only the first call is working, all subsequent calls error due to lock. 

 

EDIT: If I run the programs individually, they all work fine, running simulataneously, however when I highlight a few at a time and run together or run from branch then the lock errors occur. 

Ask a Question
Discussion stats
  • 3 replies
  • 89 views
  • 0 likes
  • 3 in conversation