Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
evanswillo

New User

Joined: 28 Jun 2007
Posts: 23
Location: Bmth England

 Posted: Thu Jan 24, 2008 7:40 pm    Post subject: Rexx Find diff between times strings I have a report that shows jobname timestart timefinish delayreason POAX962 20:00:23.49 20:00:35.83 WLB PRIORITY I need to calculate the elasped time between the two times. As the times are parsed out from a dsn they are just a string of characters is there some way I can convert them in time values to allow the calculation to be made.

superk

Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

 Posted: Thu Jan 24, 2008 7:58 pm    Post subject: Reply to: Rexx Find diff between times strings I'd just convert them into seconds, calculate the difference is seconds, and then, optionally, convert that back to HH:MM:SS.nn if desired.
evanswillo

New User

Joined: 28 Jun 2007
Posts: 23
Location: Bmth England

 Posted: Thu Jan 24, 2008 8:02 pm    Post subject: Sorry but how should I convert the sting into seconds.
enrico-sorichetti

Global Moderator

Joined: 14 Mar 2007
Posts: 10457
Location: italy

 Posted: Thu Jan 24, 2008 8:08 pm    Post subject: Reply to: Rexx Find diff between times strings that' s simple math... hours * 3600 * 100 + minutes * 60 * 100 + seconds * 100 + hundredths will give You the seconds in ( hundredths ) subtract the two numbers and ... reverse the logic to get the diff in understandable form
evanswillo

New User

Joined: 28 Jun 2007
Posts: 23
Location: Bmth England

 Posted: Thu Jan 24, 2008 8:15 pm    Post subject: Ok thanks so utilize parse to extract the H MM SS and then perform maths as there is no rexx function.
gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

 Posted: Wed Jan 30, 2008 7:01 am    Post subject: Hi, surely comparing the 2 times requires a lot more than just converting the time, what happens when the start time is just before midnight and it completes after midnight, or it starts just before midnight on the last day of the year or the job runs over a number of days ? Gerry
HappySrinu

Active User

Joined: 22 Jan 2008
Posts: 195
Location: India

Posted: Wed Jan 30, 2008 12:07 pm    Post subject: Re: Rexx Find diff between times strings

 evanswillo wrote: I have a report that shows jobname timestart timefinish delayreason POAX962 20:00:23.49 20:00:35.83 WLB PRIORITY I need to calculate the elasped time between the two times. As the times are parsed out from a dsn they are just a string of characters is there some way I can convert them in time values to allow the calculation to be made.

don't mind my suggestion might be bit vague but you can try in this way.
you can try in rexx since the in the input file the length of jobname and times don't change you can write a small rexx code to compare hours and and if hours are same/> then you can use your reutine converison to seconds and do subtract
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm How to control Panel Attributes throu... rsshanmugam CLIST & REXX 3 Mon Feb 26, 2018 9:51 pm Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us