Custom Exit Codes and Regular Expression Pattern Matching against Logs


JAMS can recognize a custom set of exit code values or regular expression patterns in the output of a job, and this pattern matching feature can be used to return success or error for that job.

In the properties of an existing or custom Execution Method, go to the completion section of the Execution Method Properties as shown below.

Under the Exit Code Handling drop down, users will have a few options with regards to which exit codes to use. A user can then fill in the appropriate values - separated by commas if users have multiple custom code values.

For regular expression patterns users should ensure that "MessageCode" is selected from the drop down menu. Standard Microsoft .NET regular expression language can be used here, including * (for wildcards) and pipe | to delimit each string.

Have more questions? Submit a request


  • Avatar
    Christophe Lauliac

    I've got a little question about that : could you give some samples about using this in a job?
    We will have some different kind jobs (SSIS, Exe, Api invoke method) that should return specific error message code.
    I'd like that all the return codes of my jobs for different kind of execution should be catched by jams.
    How can do that easily?
    Could you provide some samples?

  • Avatar
    Gennaro Piccolo

    Hello Christophe, each execution method has to be configured individually in this way to capture a message and return success or failure in a job. By default, we use 0 as the success code for all execution methods. You would need to configure a new execution method and modify it using the instructions above to capture the message code you want to consider as success or failure.

  • Avatar
    Daniel Williams

    How do I make these options appear in the first place? I've taken over an environment and some of my jobs have these options, some don't. Same execution method.

  • Avatar
    Gennaro Piccolo

    Hello Daniel, if you want to control these at the execution method level, you can click on the Job Properties tab, and then click on the Add Property button.