View previous topic :: View next topic
|
Author |
Message |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
It seems to me that you have to know if the submission is "late" or "early".
If 2 jobs are submitted: one at 23:00, the other at 01:00. If the 1 AM job is late, there's a 2 hr difference in their times and the avg start is 24:00.
If the 1 AM job is early, there's a 22 hr difference in their times and the avg start is 12:00. |
|
Back to top |
|
|
neelima.sinha
New User
Joined: 14 Sep 2007 Posts: 30 Location: Bangalore
|
|
|
|
Hi,
after all this discussion, I still did not get an answer or may be I am not understanding what is being explained.
I would try to explain again -- I am reading a file which has job name and start date and start time, passing the record via jcl to cobol program(linkage section) --- as example I have given, sometimes job may start midnight , some times after midnight, in such case I want to know what was average start time.
as for example
if a job start at 23:59 and the other day at 00:01 the average start time is midnight 00:00hrs, this is the answer I am looking for.
can anybody explain now in a more simpler way or via some sample code
Regards, |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Convert the hours and minutes to minutes, take the average and convert the average back to hours & minutes. Details are up to you. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
if a job start at 23:59 and the other day at 00:01 the average start time is midnight 00:00hrs, this is the answer I am looking for. |
funny mathematics...
in mathematics You must express rules
the average for 23.59 and 00.01 is 12.00
express Your outlook in terms of a mathematical rule/constraint
not based on the fact that You know that usually Your jobs run around midnight
unless as already said in my previous posts You choose a different time window
for a default time window starting at 00:0 for 24 hours the average is 12:00 |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
If your time window is 12:00 - 12:00 ie noon to noon, try the following
If the hours are less than 12 add 24 to the hours
Convert the hours and minutes to minutes
add up all the minute values
divide by the number of values
convert the average back to hours & minutes
If the hours are greater than 24 subtract 24. |
|
Back to top |
|
|
|