I have a file where each record lists the name of a program, its run date, and CPU used in format 'mm:ss'
What I want to do is end up with one record for each program and the total run time summed on the record. First I just summed the minutes and ignored the seconds. Then to be more accurate I shifted columns around so that the time on the records would be in format 'mm:sssss' and then summed on each of the minutes and seconds.
So for example if I had two records with times of '03:45' and '03:44' I would end up with a summed record showing a time of '06:00089'. I need all those leading zeroes since some jobs can run over a hundred times in the periods I am looking at.
Is there a way to instead have the '06:00089' come out as '07:29'?
I looked through what manuals I have under the SUM command but couldn't come up with anything.
Here's a technique you can use with DFSORT to do what you want. Since you didn't give any of the details of what your input records actually look like or what you want for output, I made up my own example to give you the idea. Adjust as needed:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
* Put 0000mm in 41-46. put 0000ss in 51-56.
* Sort on the program name.
* Sum on 0000mm and 0000ss for each program name.
* Get xxx:yy where xxx=(mm/60)+hh and yy=mm//60.