Re: [CMS-PIPELINES] PIPE vs timestamp math

2024-05-17 Thread Rob van der Heij
I like this with an extra REXX stage. But you could also use the "x2t"
conversion in SPEC and then use "greg2sec" for the full seconds part, and
divert the fraction for the microseconds.

/* TIMEDIFF REXX Compute difference between two TOD clocks   */
/*   Author: Rob van der Heij, 17 May 2024   */

struct = ':clock',
 'tod1 u l 8',
 'tod2 u l 8'

'callpipe  var struct | structure add caller'

'callpipe (end \ name TIMEDIFF.REXX:6)',
   '\ *: ',
   '| spec w1 x2c 1 w2 x2c n ',
   '| spec qual clock 1 print (tod2-tod1)/4096 1 ',
   '| *: '

error: return rc * ( rc <> 12 )

PIPE literal DE8843348E581000 DE8843348E63B000 | timediff  | cons
186
Ready; T=0.01/0.01 18:08:09

On Fri, 17 May 2024 at 23:49, Stanislawski, Shawn  wrote:

> I have a file containing job start and finish times, as a pair of TODABS
> values per line.
> I would like to calculate the delta between the second TODABS value and
> the first TODABS value, and output in format dd:hh:mm:ss.uu
> How would this be possible using PIPE?  (I figure the SPEC stage is
> probably the answer, but I'm struggling with the delta calculation portion.)
>
> Input example:
> DE8843348E581000 DE8843348E63B000
>
> Desired output:
> 0:00:00:00.000186
>
> --Shawn S.
>
>
>
>


[CMS-PIPELINES] PIPE vs timestamp math

2024-05-17 Thread Stanislawski, Shawn
I have a file containing job start and finish times, as a pair of TODABS values 
per line.
I would like to calculate the delta between the second TODABS value and the 
first TODABS value, and output in format dd:hh:mm:ss.uu
How would this be possible using PIPE?  (I figure the SPEC stage is probably 
the answer, but I'm struggling with the delta calculation portion.)

Input example:
DE8843348E581000 DE8843348E63B000

Desired output:
0:00:00:00.000186

--Shawn S.