Hi,
I need to subtract two TOD times to find elapsed time. Currently I convert
the two TOD times with STCKCONV and determine the elaped time individually,
and then compute the difference. This works. However I thought I could
optimize the conversion, a little bit and I was wondering why not subtract the
two TOD times to begin with.
As I understand TOD time is the number of mic seconds elapsed since midnight
of 1900-01-01. So when I subtract one TOD value from another the duration
must be in micro seconds.
For example, TOD1 is X'C0E608EF7409002E' ===>2007196, 16.59.58,745744
TOD2 is X'C1E608EF7409002E' ====> 2008035, 7.43.04.790160
If I subtract the two TOD values, it is binary as in (x'0100000000000000'). If
I
convert to a packed decimal value, I get a decimal value of
72057594037927936. (sign bit not shown here)
Now I can't seem to figure the actual elapsed time based on the derived micro
seconds. If I just treat the above value as a mic seconds then I end up with
2284.93 years which is gloriously incorrect while the actual elapsed days are
204 days ignoring the time part.
I am sure I am missing something here. Can someone please help.
Regards,
Ludmil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html