gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
It's a bit hard to give you an accurate solution, you should try to be a little bit more descriptive... but maybe this can solve your problem:
Code: |
//JS010 EXEC SORT,COND=(4,LT)
//SORTIN DD *
01:02:30
02:03:20
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1,80,C'1',(15,2,ZD,MUL,+3600),ADD,(18,2,ZD,MUL,+60),
ADD,21,2,ZD,TO=ZD,LENGTH=12)
SORT FIELDS=(81,1,CH,A)
SUM FIELDS=(82,12,ZD)
OUTREC FIELDS=(19X,82,12,ZD,DIV,+3600,EDIT=('TT'),C':',
82,12,ZD,DIV,+60,SUB,
(82,12,ZD,DIV,+3600),MUL,+60,EDIT=('TT'),C':',
82,12,ZD,SUB,
(82,12,ZD,DIV,+3600),MUL,+3600,SUB,
(82,12,ZD,DIV,+60),MUL,+60,EDIT=('TT'))
|
This will give you the answer in HH:MM:SS, on the 20th position of the output.
I've assumed that the sum of the times is not going to be greater than 99 hours. |
|