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

Some examples running with Control-M and Control-EM database.
Post Reply
User avatar
sunuriyal
Nouveau
Nouveau
Posts: 27
Joined: 18 Jan 2014 12:00

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

Post by sunuriyal » 27 Jan 2014 10:00

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..

User avatar
controld
Nouveau
Nouveau
Posts: 6
Joined: 14 Apr 2009 12:00

Post by controld » 15 Apr 2014 8:18

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.

User avatar
jCarlos
Nouveau
Nouveau
Posts: 36
Joined: 19 Jun 2013 12:00

Post by jCarlos » 17 Apr 2014 1:45

what kind of database are you using?

User avatar
sunuriyal
Nouveau
Nouveau
Posts: 27
Joined: 18 Jan 2014 12:00

Post by sunuriyal » 24 Apr 2014 12:33

Thats cool.

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

ctmpsm -listall TIME |grep "executing"

It worked :)

Post Reply