BookmarkSubscribeRSS Feed
tbatliner
Calcite | Level 5
Dear all,

since a couple of days we are facing some autoexec-issues: we %include the source code for our macros in the appserver_autoexec.sas which was very fine until recently.
Now we get the below error message more and more often and we have no idea what could be the reason...of course the problem here is that then our batch-job will fail to run.
Here's the log-excerpt (we are using SAS 9.1.3. SP4 on Windows Server 2003):
ERROR: A lock is not available for WORK.SASMACR.CATALOG, lock held by another process.
ERROR: A dummy macro will be compiled.


Any input would be highly appreciated,
br Thomas
8 REPLIES 8
DanielSantos
Barite | Level 11
Hmmm.

Has any macro included from appserver_autoexec.sas been changed lately?

Could be a macro that has some compiling issues...

Cheers from Portugal.

Daniel Santos @ www.cgd.pt.
tbatliner
Calcite | Level 5
No that can't be the reason because most of the times it still works but only sometimes crashes. Unfortunately the error is not reproducible.

Thanks for the idea 🙂

br Thomas
DanielSantos
Barite | Level 11
OK then.

It could be a misuse of some macro. Say some "weird" parameter value passed to the macro that is messing with the macro code. Not easy to diagnose.

One thing is sure, If everything was alright a couple of days before, something changed and provoked this behavior. I suggest you start from there, and try to identify what scripts have been modified recently.

Best of luck.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt.
ballardw
Super User
This looks like multiple sessions of SAS are trying to access the same physical WORK library. If you test your batch job with an interactive session running I would expect this error.
tbatliner
Calcite | Level 5
We are indeed using SAS/Connect sometimes to change the user during code execution. The strange thing is that it works most of the times, then it fails with the mentioned error.

I'll try to add some code to the autoexec.sas which checks for (compiled) macros and that deletes them.

br Thomas
Peter_C
Rhodochrosite | Level 12
for another approach:
as you use %include of common code, I assume you normally include the same collection of macros. Have you tried pre-compiling the macros with the mSTORED option?
It should be straight forward to prepare the catalog and move into the server on a one-off basis. In the server, place it somewhere that can be addressed by your users on a read-only basis. That should stop the contention lock.

just my $0.02
PeterC
DanielSantos
Barite | Level 11
Hmmm. Strange.

For every session SAS creates/allocates a newly WORK lib with a randomly choosen directory name under the global WORK path (check fort hte -WORK option in your CFG file for the global WORK path). So it is virtually impossible to have two sessions sharing the same physical WORK lib.

I would bet in some missing %mend or quote, or parameter misuse that is messing with the macro compiler and locking the catalog.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt.
lu
Calcite | Level 5 lu
Calcite | Level 5
Hi

very high find this's 'fantom' bug. I think you need
exclude WORK (-work option from config file) folder and it's subfolder from antivirus checking on your machine

some antivirusis lock new created files for virus scan.

lu

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 7179 views
  • 0 likes
  • 5 in conversation