Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Summing Minutes:Seconds on a file?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Div Grad

New User


Joined: 08 Apr 2005
Posts: 43

PostPosted: Fri Sep 08, 2006 1:18 am    Post subject: Summing Minutes:Seconds on a file?
Reply with quote

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.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 08, 2006 3:27 am    Post subject:
Reply with quote

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:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
PGMA  03:45
PGMA  03:44
PGMB  35:67
PGMB  18:54
PGMC  27:31
PGMC  19:06
PGMC  99:59
PGMD  15:04
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
* Put 0000mm in 41-46.  put 0000ss in 51-56.
  INREC OVERLAY=(41:4C'0',7,2,51:4C'0',10,2)
* Sort on the program name.
  SORT FIELDS=(1,4,CH,A)
* Sum on 0000mm and 0000ss for each program name.
  SUM FIELDS=(41,6,ZD,51,6,ZD)
* Get xxx:yy where xxx=(mm/60)+hh and yy=mm//60.
  OUTREC BUILD=(1,5,
      6:51,6,ZD,DIV,+60,ADD,41,6,ZD,TO=ZD,LENGTH=3,
      C':',51,6,ZD,MOD,+60,TO=ZD,LENGTH=2)
/*


SORTOUT has:

Code:

PGMA 007:29
PGMB 055:01
PGMC 146:36
PGMD 015:04
Back to top
View user's profile Send private message
Div Grad

New User


Joined: 08 Apr 2005
Posts: 43

PostPosted: Sat Sep 09, 2006 8:06 am    Post subject: Re: Summing Minutes:Seconds on a file?
Reply with quote

Frank - Thanks again! This will save a lot of time for me.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us