home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / GCP$.ZIP / cistime.cmd next >
OS/2 REXX Batch file  |  1992-10-08  |  875b  |  39 lines

  1. /* */
  2. Arg month
  3.  
  4. month = STRIP(month)
  5. If month = "" then Do
  6.     month = SUBSTR(DATE('S'), 5, 2)
  7. End
  8. Else Do
  9.     If ((month < 10) & (LEFT(month,1) <> '0')) then
  10.         month = "0"month
  11. End  /* Do */
  12. fmonth = month
  13. if (left(fmonth, 1) = '0') then
  14.     fmonth = SUBSTR(fmonth, 2)
  15. File = "LOG"fmonth"-92.CIS"
  16. timefile = '.\temp.tme'
  17.  
  18.  
  19. Do Queued(); Pull .; End
  20. '@TYPE 'file' | FIND "S 'month'/" | cut -w7 | RXQUEUE'
  21.  
  22. totalhrs = 0
  23. totalmins = 0
  24. totalsecs = 0
  25. Do Queued()
  26.     Pull time
  27.     Parse Var time mins ":" seconds
  28.     totalmins = totalmins + mins
  29.     if seconds > 0 then totalmins = totalmins + 1
  30.     If totalmins > 59 then Do
  31.         totalhrs = totalhrs + 1
  32.         totalmins = totalmins - 60
  33.     end  /* Do */
  34. End /* do */
  35.  
  36. Say "Time spent was "totalhrs":"totalmins":00"
  37. Cost = 36*totalhrs + totalmins * (36/60) 
  38. Say "Cost is $"Cost
  39.