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 http://support.sas.com/rnd/emi/APM93/apm93.faq.html )
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);
To
%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.
Tim