select top 100 js.last_run_date ,j.name, js.step_id,js.step_name,js.last_run_date,jsl.log,jh.message from msdb.dbo.sysjobhistory jh
join msdb.dbo.sysjobs j on j.job_id = jh.job_id
join msdb.dbo.sysjobsteps js on js.job_id = jh.job_id
join msdb.dbo.sysjobstepslogs jsl on jsl.step_uid = js.step_uid
where jh.run_status in (0) -- 0 Failed, 1 successful, 2 retry, 3 Canceled, 4 In-progress, 5 unknow
and last_run_date>=CONVERT(varchar(100),dateadd(d,-3, GETDATE()), 112)
order by js.last_run_date desc,j.name,js.step_id