Return codes in VMS differ from those in AE. Value "1" in VMS signals that a job has successfully been processed. "0" stands for warnings. In AE, it is the opposite way round. Return code "0" stands for a successful execution and values other than "0" signal errors.
If the agent sends return code "0" to the AE system, this equals code "1" in AE.
Warnings and successful job executions cannot be distinguished. Automic strongly recommends analyzing the variable $severity whenever a VMS command has been processed. It contains the return code of the last command. Further job processing can then be handled via script.
Use an Include object for analyzing the variable $severity. In doing so, the relevant script lines must only be maintained in one object and can be included in any job.
Example for an Include object:
$ RETCODE = $severity
$ if (RETCODE .EQ. 0)
$ then
$ RETCODE = 3
$ goto RETURN
$ endif
The system checks whether the returned code is a warning. If so, job execution is continued in the Trailer. "goto RETURN" leads to the Include object "TRAILER.VMS" which is processed when a job has ended.
See also: