AutoSys Workload Automation

 View Only

  • 1.  Autosys Job Exit code issue

    Posted Feb 27, 2025 03:02 AM

    Hi Team,

    Greetings..!

    Help is appreciated here..!

    I have an mainframe batch job runs in Heirloom EBP(we use script files to set the Return code of job as 0 to 7 as success and 8 as failure) not in Z/OS.I am facing an issue of below..
    I have a job "Job A" throwed an false alert of Exit code "02" in Autosys, though the job ran with RC(return code) 0 in EBP.

    please let me know any issue from Autosys scheduling perspective?

    Thanks,
    Vinothini




  • 2.  RE: Autosys Job Exit code issue

    Broadcom Employee
    Posted Mar 03, 2025 10:17 PM

    Hi Vinothini,

    I am assuming that you are running a command job calling the script you mention.  Autosys will return the exit code from the script, not from what the script calls.  Is the problem that the exit code of 2 is showing as a failure or that you are expecting a return code of 0?

    If it is getting a failure for the eit code of two just update your job to use either max_success or success_codes to have it return a success.

    If the problem is the unexpected exit code, I would suggest working with the application team and see if the logs contain any information on why a 2 was returned.

    Regards,

    Mike




  • 3.  RE: Autosys Job Exit code issue

    Posted Mar 05, 2025 09:05 AM

    Thanks Michael for reply..

    If it is getting a failure for the exit code of two just update your job to use either max_success or success_codes to have it return a success.
    I got answer for my question..Thanks again..
    ---------------------------------------------------------------------------------------------------------------------
    Have also a another question which I experience in using Autosys to run batch jobs using scripts.
    Autosys captured Exit code as "0"
    But Job actually ends with "CC 8"
    I verified autosys scheduling JIL sheet, which looks good to me..
    But my question is why Autosys captured "0" and made success instead of abend/alert??? 
    Have attached screenshot for reference..
    Please share your thoughts..!

    Thanks,
    Vinothini




  • 4.  RE: Autosys Job Exit code issue

    Broadcom Employee
    Posted Mar 05, 2025 09:58 AM

    Hi,

    Autosys captures the exit code of the script.  The messages you show are z/OS messages, but is the script setting a return code based on those messages?  you would need to check the script on how it is setting the exit code.  A quick test would be if you run the script from a shel session and then immediately run the command 'echo $?' to see what exit code is being returned.  That will be the exit code that autosys is picking up.

    Regards,

    Mike