Query to get status of all jobs in Autosys

The below query will help to find the status of jobs in Autosys. You need to run the query against the SQL Server database backend of Autosys.

In the query I have declared a variable @GMTOffset. To get the GMTOffset value you can get the Offset value from the table “ujo_alAmOde”.

Declare @GMTOffset int;

select @GMTOffset = Int_val from ujo_alAmOde where [type] = ‘gmt_offset’; — (you need to get the GMTOffset value from ujo_alAmOde table)

jt.joid,jt.job_name,jt.job_type, jt.machine,
dateadd(second,jt.last_start-@GMTOffset,’1970-01-01′) as start_time,
dateadd(second,jt.last_end-@GMTOffset,’1970-01-01′) as end_time,
dateadd(second,jt.status_time-@GMTOffset,’1970-01-01′) as Last_Status_Time,
from ujo_jobst jt inner join ujo_INTCODES i
on i.fld = ‘status’ and i.code = jt.status
where i.text not IN (‘SUCCESS’ , ‘RUNNING’ , ‘STARTING’,’ACTIVATED’)
ORDER BY job_type

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s