Getting job exit codes
search cancel

Getting job exit codes


Article ID: 238062


Updated On:


CA Workload Automation AE


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


Release :

Component :


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>

$ 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


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