AutoSys Workload Automation

 View Only
  • 1.  Can I fail an Autosys job on basis of the outcome of the task done.

    Posted Jul 17, 2020 10:56 AM
    Hi there,

    I have an Autosys job which runs and does some task related to files. Now in the scenario when the task fails the autosys logs the outcome but since Autosys ran completely, it shows success. What I want is in case the background task fails I want the Autosys job to show as failed.

    Is there a way I can achieve this??

    ------------------------------
    Pallav Kumar
    ------------------------------


  • 2.  RE: Can I fail an Autosys job on basis of the outcome of the task done.

    Posted Jul 18, 2020 09:54 AM
    Hi Pallav,

    You can manage the same at your script level by adding the checks..


  • 3.  RE: Can I fail an Autosys job on basis of the outcome of the task done.
    Best Answer

    Broadcom Employee
    Posted Jul 18, 2020 11:56 AM
    Hi Pallav,

    The success or failure of the job is determined by the exit code of the script or program.  By default, 0 is success and anything else is failure.
    It is up to the developer of the script to ensure the exit code is appropriate.  I have seen where the exit code can also give a 'cause' of the failure.  Say an 0 means success, a 2 means that the file data was not valid, a 4 means that a file system was full or something.  This should of course be documented somewhere.
    If you want, you could even use the exit code to determine the next job that runs.  for example: condition: exitcode (JobA) = 4
    Here is a link for more details on it: https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/intelligent-automation/workload-automation-ae-and-workload-control-center/11-3-6-SP8/reference/ae-job-information-language/jil-job-definitions/condition-attribute-define-starting-conditions-for-a-job.html#concept.dita_786915b26a4b3d5a37f3cedc0c9adf3d406804ea_ExitCodeDependencies

    Regards,
    Mike



  • 4.  RE: Can I fail an Autosys job on basis of the outcome of the task done.

    Posted Aug 05, 2020 02:54 AM
    Hi,

    Maybe you can use OMTF jobs.

    "You can define a Text File Reading and Monitoring (OMTF) job to search a text file on a Windows, UNIX, or i5/OS computer for a text string. For example, you can monitor a log file for an error message after a script executes."

    Best regards
    José