How to capture the failed job status in the control table

Hi,

I want to capture the job execution details in the target table.

If the job executed successfully , we can capture the status,start time & end time properly.

If the job fails with errors that is not captured by try/catch block, how can we capture the end time & status in the control table.

Please suggest me this.

Thanks & Regards,

Ramana.

​


Ramana :india: (BOB member since 2009-04-30)

Hi, Ramana,

You can start looking in the AL_HISTORY table. Anyway, since the End job details (either succesfull or failed) are written after the job ends (logically) you cannot capture that in the job… but you can write the JOB ID when the job starts in a table and then use it to reference the OBJECT_KEY of the history to get the rest of the information.

Ther are other ways, but this could help you to start solving your requirements,

Regards,

Andrés


aidelia :argentina: (BOB member since 2006-02-02)