Wednesday, July 10, 2013

How to get a job to email the SYSOUT

Update the STEPS panel of the failing job with the following statements:

      On Stmt=*            Code=COMPSTAT!0 (or NOTOK or other specific return codes)
      DO Set-Var          %%\G_ORDERID                %%ORDERID
      DO Set-Var          %%\G_JOBNAME               %%JOBNAME
      DO Set-Var          %%\G_MAILADDRESS
      Do Force-Job      Table=YourTable                 Jname=EMAILSYSOUT

Note: The “Do Set-Var” is setting global variables to be passed to another job. Global variables are defined using a backslash.
The global variables are used in the other job without the backslash.

Force job definition: Job name EMAILSYSOUT

On the command line:
ctmpsm -LISTSYSOUT 000%%G_ORDERID |mailx -s "Job %%G_JOBNAME failed. See sysout attached!" %%G_MAILADDRESS

Note: The Node-id on the Execute tab must be the home server for Control-M.


Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Awesome Deals | Bloggerized by Mahendra - 24x7FunOnline