search cancel

Getting job exit codes

book

Article ID: 238062

calendar_today

Updated On:

Products

CA Workload Automation AE

Issue/Introduction

autorep can provide job status, but is there a way to get the actual exit code for all or a select group of jobs?  

Environment

Release :

Component :

Resolution

There is no other specific autosys command aside from autorep that ships with the product that displays the jobs' exit code.
You can see it via autorep -J <jobname>
example:

[[email protected] bin]$ autorep -J exit*

Job Name                                                         Last Start           Last End             ST/Ex Run/Ntry Pri/Xit
________________________________________________________________ ____________________ ____________________ _____ ________ _______
exitcode123                                                      2022/03/29 11:21:17  2022/03/29 11:21:17  FA    285265/1 189

the exit code for the above job is 189

The other ways I can check or see an exit code for a job are:

Via the AEWS web server

https://<AEWS_webserver_host>:9443/AEWS/[email protected]*
or
https://lvntest014023.bpc.broadcom.net:9443/AEWS/job-run-info/exitcode123

Or via WCC's QuickView

The information is in the database in the ujo_job_runs and ujo_job_status tables but we do not advise going after them directly as the schemas can and do change from version to version.  

So some direct SQL you write for version X may not work in a later version. 

Also unexpected queries against the db can impact the databases's performance and in turn impact AutoSys's performance.

Another option would be to code your own command using the autosys SDK.
Using API's like GetJobRunsWithFilterReq can return the exit code for jobs.
For more details on the SDK see the $AUTOSYS/../Documentation/asapidoc.jar