Autosys is a tool which helps automating jobs across platforms. I had this need to find the status of a Job but all I knew was that the command used in the Job. When you have 2-3 jobs its quite easy to find the job and the status but when you have 100+ jobs its easy to run a query to get the information.
The below query can be used to find information about the job status.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)
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
dateadd(second,jt.status_time-@GMTOffset,’1970-01-01′) <> ‘1970-01-01 01:00:00.000’
–and joid in (JOB_ID_OF_THE_JOBS_IF_KNOWN)
–and job_name like ‘%NAME_OF_THE_JOB%’ — NOTE: EVERYTHING IS CASE SENSITIVE
and jt.command like ‘%PART_OF_THE_COMMAND%’ — NOTE: EVERYTHING IS CASE SENSITIVE
ORDER BY Last_Status_Time desc
Note: Instead of Command, if you have “job id ” or “job name” you could uncomment those conditions.