Page 1 of 1

Script to report jobs that are executing for more than 12 hr

Posted: 27 Jan 2014 10:00
by sunuriyal
Hi All,
I want write a script that should report me all the jobs that are running over 12 hours. I started it using "ctmpsm -listall |grep executing"
but it lists all the jobs that are currently executing. How can I filter the list of jobs running over 12 hours out of this list ?

Please help. Thanks in advance..

Posted: 15 Apr 2014 8:18
by controld
Hi,

You can try the below query in a script

select ORDERNO,APPLGROUP,JOBNAME,STATUS,STATE,STARTRUN,ENDRUN,ORDER_TIME from CMR_AJF where STARTRUN < 'yyyymmddhhmmss' and STATE = '4'

This should help.

Posted: 17 Apr 2014 1:45
by jCarlos
what kind of database are you using?

Posted: 24 Apr 2014 12:33
by sunuriyal
Thats cool.

I don't have db access. I did that using "ctmpsm" utility.

ctmpsm -listall TIME |grep "executing"

It worked :)