Job Run Count Report

A lot of scripts ans example to extract information from Control-M tools.
Post Reply
dograv

Job Run Count Report

Post by dograv » 22 Jan 2010 2:34

I am looking for a report to determine number of jobs executed in my enviornment. i used Extreme Peak Usage report from reporting facility to generate detail of number of jobs executed in a CONTROL-M/Server. however; the numbers are confusing the number of job runs are more then the job definitions in a given enviornment. Job executions can be more then the definitions (cyclic jobs etc.)

So is it the only report and mechanism available if i want to know number of jobs runs in a given time frame for a given control-m/server.

id there any table where i can runa sql to extract this information..?

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 22 Jan 2010 7:39

dograv,

The controlm log is the richest source of data for your question.
You can SQL select the date and time of event, the id of the job, the message tex etc...

If you want to check the absolute number of submission during a time frame, you can execute a request like this:

select count(*) from CMR_IOALOG
where LOGDATE+LOGTIME > '20100120090000'
and LOGDATE+LOGTIME <20100120100000> '20100120090000'
and LOGDATE+LOGTIME < '20100120100000
and MESSAGE like '%SUBMITTED%'


etc..

Cheers
Nicolas Mulot

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 22 Jan 2010 5:21

dograv,

Sorry, the previous message has been corrupted and should have looked like this:

The controlm log is the richest source of data for your question.
You can SQL select the date and time of event, the id of the job, the message text etc...

If you want to check the absolute number of submission during a time frame, you can execute a request like this:

select count(*) from CMR_IOALOG
where LOGDATE+LOGTIME > '20100120090000'
and LOGDATE+LOGTIME < '20100120100000'
and MESSAGE like '%SUBMITTED%'


If you want to check the number of job orders submitted during the same time frame, you could use the following:

select count(distinct ORDERNO) from CMR_IOALOG
where LOGDATE+LOGTIME > '20100120090000'
and LOGDATE+LOGTIME < '20100120100000'
and MESSAGE like '%SUBMITTED%'


etc..
All of the above is MSSQL format.

Cheers
Nicolas Mulot

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 27 Jan 2010 11:51

first you must know wich are the actives tables in your EM
second you must sumitt it just before new day procedure
third i use the followings
liste_tables_jobs () {
tmp=/tmp/$$liste_tables_jobs$$
SQL -U${user} -P${pass} -b <<EOF> ${tmp}
set nocount on
select name from sysobjects where name like "${date_code}"
go
EOF
cat ${tmp}
rm ${tmp}
}

dc_namecode () {
SQL -U${user} -P${pass} -b <<EOF>> ${dcname}
}

ord_count () {
SQL -U${user} -P${pass} -b <<EOF>> ${ord_count}
}

rerun_count () {
SQL -U${user} -P${pass} -b <<EOF>> ${rerun_count}
}

i shoud have the following result :
100126 CO 001 SAPPDT OD(Ended) 130 RERUN 2270 TOT_RUN_DC 2400
100126 CO 003 SAPP3F OD(Ended) 90 RERUN 331 TOT_RUN_DC 421
100126 CO 006 SAPDEV OD(Ended) 1286 RERUN 9170 TOT_RUN_DC 10456
100126 CO 015 SAPP3A OD(Ended) 826 RERUN 5616 TOT_RUN_DC 6442
100126 CO 017 SAPP3D OD(Ended) 201 RERUN 738 TOT_RUN_DC 939
100126 CO 018 SAPP3G OD(Ended) 577 RERUN 1416 TOT_RUN_DC 1993
100126 CO 032 SAPP3B OD(Ended) 7568 RERUN 30111 TOT_RUN_DC 37679
100126 CO 065 EDDDEV OD(Ended) 208 RERUN 6991 TOT_RUN_DC 7199
100126 CO 066 SVGP02 OD(Ended) 139 RERUN 296 TOT_RUN_DC 435
100126 CO 069 SVGP01 OD(Ended) 132 RERUN 540 TOT_RUN_DC 672
100126 CO 071 SAPPE1 OD(Ended) 176 RERUN 858 TOT_RUN_DC 1034
100126 CO 101 EDDPRD OD(Ended) 4818 RERUN 15919 TOT_RUN_DC 20737

-------------------------------------------------------------------------------
Total run EM en date du 100126 a 03:50:15 : 90407
-------------------------------------------------------------------------------

regards
philmalmaison

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 09 Feb 2010 4:35

dc_namecode () {
SQL -U${user} -P${pass} -b <<EOF>> ${dcname}
set nocount on
select DATA_CENTER from COMM
where
CODE = "${code}"
go
EOF
echo >> ${dcname}

}

ord_count () {
SQL -U${user} -P${pass} -b <<EOF>> ${ord_count}
}

rerun_count () {
SQL -U${user} -P${pass} -b <<EOF>> ${rerun_count}

}

purge_counts () {
if [ -s "$HOME/stats/countEM*" ]
then
find $HOME/stats/countEM* -mtime +6 -exec rm {} \;
fi
}

#
# Main
#
verif_config ;
purge_counts ;
total_run=0
h_trait=`date +'%H:%M:%S'`
liste_tables_jobs | while read line
do
echo "line : ${line}"
date_comm=`echo ${line} | awk '{ print substr($0, 2, 6)}'`
if [ "X${date_comm}" == "X${journee}" ]
then
code=`echo ${line} | awk '{ print substr($0, 8, 3)}'`
dcnamedate=`dc_namecode`
ord_counter=`ord_count`
rerun_counter=`rerun_count`
total_counter=`expr ${ord_counter} + ${rerun_counter}`
echo "date:${date_comm} code:${code} dc_name:${dcnamedate} orderid(ended):${ord_counter}\
nbre rerun:${rerun_counter} total run du DC: ${total_counter}" >> ${compte_de_jobs}
total_run=`expr ${total_run} + ${total_counter}`
fi
done
echo >> ${compte_de_jobs}

Post Reply