Updating JOBS return code based on string in report

book

Article ID: 223079

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

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.

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Resolution

Please take a look at the documentation regarding output scans in Automic Automation: https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.3/Automic%20Automation%20Guides/help.htm#AWA/Objects/obj_output_page.htm#link4

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.