Architecting, installing and maintaining your SAS environment

APM macros causing warnings on batch server processes

Posts: 50

APM macros causing warnings on batch server processes

Hi everyone,

I had an issue relating to APM today which I have managed to resolve but couldn't find any information on the subject online so thought I would post my results incase someone else hits the same problem.

We recently had a new installation of the EBI suite onto our server and had APM set up so we could take advantage of all the monitoring processes it does.

Aside from the ridiculous amount of notes that started turning up in everyone's log files everything was going ok until we tried scheduling some processes to run through the batch server. In our case using lsf.

  (On another note, I surpressed the extra apm notes by editing the workspace server logconfig.apm.xml file as described at the bottom of this article  )

Basically, every process we ran was being flagged as finishing with a non-zero exit code. Single step processes were still executing fine despite always sending failure emails, however for a more complicated flow which relies on previous step executing without error the flow wouldn't get past the first step.

Looking through the logs the exit code was caused by a warning very early in the process due to a non-existent environment variable queried by %sysget.

Since we don't use %sysget in any of our own code it wasn't hard to find the reference to %sysget in the %apm_armsetup macro.

Looking at the code in this macro it was coded to handle the situation where %sysget does not return any result however it does this after the warning has already been raised.

Luckily, once I had found the issue it was fairly simple to fix by altering the line in the macro from

      %let serverClass=%sysget(serverClass);


      %if sysfunc(sysexist(serverClass)) %then %let serverClass=%sysget(serverClass);

Which makes sure that %sysget is only run when the environment variable actually exists, preventing the Warning and allowing the batch processes to run as before.

Hopefully this will help someone else who hits this issue.


SAS Employee
Posts: 61

Re: APM macros causing warnings on batch server processes

Posted in reply to TimCampbell

Great catch Tim. Thanks very much for a brilliant write up on this issue.

This certainly did help another person who also hit this issue.

Trusted Advisor
Posts: 3,215

Re: APM macros causing warnings on batch server processes

Posted in reply to TimCampbell

To add:

- Check the current dir of the batch server it is not the home dir as normally expected

- the log file notation is 12hr based one , you would 24hr as normal

- when apm is active spaces in source names are not allowed anymore. I think this issue already exists in the batch server script. Using the foundation entry directly allows spaces when proper quoted.

Why this way to publish and not with TS fir a fix or kb note?

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 3 in conversation