If the highest unit you are working toward is "days", it's actually quite simple to calculate. That's because you don't have to deal with months and years of differing lengths.
* subtract start-STCK from end-STCK : = duration * shift result 12 bits to the right : = microseconds * divide by 1000000 : quotient = seconds ; remainder = microseconds * divide by 60 : quotient = minutes ; remainder = seconds * divide by 60 : quotient = hours ; remainder = minutes * divide by 24 : quotient = days ; remainder = hours If you save your remainders and quotients (in decimal) in the correct sequence, you could format the entire thing in one ED instruction. DDD days HH:MM:SS.ssssss X'4020212040',C'days',X'4020203A20203A20204B202020202020' Try it! You may like it. === > Date: Fri, 12 Jun 2015 09:39:38 -0500 > From: [email protected] > Subject: Re: STCK question > To: [email protected] > > As these things go, I have found new uses for my little routine. It's strong > enough to find the elapsed time for larger numbers than I intended. So much > so, I thought I'd add a function to show the elapsed time since the beginning > of my started task. The time is working wonderfully but when I cross the > more than a day boundary I'd like to display the number of days since the > start of the program. > > I wound up using the > > STCK-STCK difference in times since the start of the started task > + 1972/01/01 add in base STCK time to get a STCK value again > STCKCONV convert that to DATE=YYYYMMDD TIME=DEC > ED make it character based > > sequence so I have > > 1972/01/03 23:15:06.238744 > > What I'd like is > > 2 days 23:15:06.238744 > > I can calculate the date difference by hand (in C based off of the character > representation of the date) of course. Unless someone knows of a nifty > method to get the elapsed number of days from the data that I have? > > Janet > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
