search cancel

Updating JOBS return code based on string in report


Article ID: 223079


Updated On:


CA Automic Workload Automation - Automation Engine CA Automic One Automation


When using certain applications (like DNA), sometimes the application returns a non-zero return code but needs to be considered successful based on information in the Job Report itself.  This is a guide for an example in setting that up so that whatever causes it to abort in Automic Workload Automation is ignored and it instead completes successfully.  Please reach out to the community or to your account team to discuss customized solutions specific to your requirements and environment.


Release : 12.3



Please take a look at the documentation regarding output scans in Automic Automation:

As a very basic example:
If there is a Windows job that runs the command: dur
It will fail with a return code 9009 which can be seen in the footer info on the job report (REP):

UCMDJP: **                                RET-CODE:          9009          **

To "catch" this and say that it should end ok instead, use the following steps:

  1. create a filter object
  2. under "Report" in the filter, choose "Report Type" of "Report" (on the right it will say "REP")
  3. Choose "Condition" of "Contains"
  4. Since the same string will show up every time, add a filter string of something like: 
    RET-CODE:          9009
  5. Click the Add button and save the Filter object
  6. Open the JOB object and go to the "Output" tab and then the "Output-Scan" sub-tab
  7. Under the Filter Object column, choose the filter created above in step 1
  8. Check "Filter Criteria Apply"
  9. Update "Set Return Code" to 0
  10. Add a status text as needed
  11. Save the JOB object

Now when the job runs and has that string in the report, it will get an ENDED_OK status instead of ENDED_NOT_OK.