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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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