Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Rexx Find diff between times strings

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
evanswillo

New User


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

PostPosted: Thu Jan 24, 2008 7:40 pm    Post subject: Rexx Find diff between times strings
Reply with quote

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

superk

Moderator Team Head


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

PostPosted: Thu Jan 24, 2008 7:58 pm    Post subject: Reply to: Rexx Find diff between times strings
Reply with quote

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

New User


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

PostPosted: Thu Jan 24, 2008 8:02 pm    Post subject:
Reply with quote

Sorry but how should I convert the sting into seconds.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Thu Jan 24, 2008 8:08 pm    Post subject: Reply to: Rexx Find diff between times strings
Reply with quote

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

New User


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

PostPosted: Thu Jan 24, 2008 8:15 pm    Post subject:
Reply with quote

Ok thanks so utilize parse to extract the H MM SS and then perform maths as there is no rexx function.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jan 30, 2008 7:01 am    Post subject:
Reply with quote

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

Active User


Joined: 22 Jan 2008
Posts: 195
Location: India

PostPosted: Wed Jan 30, 2008 12:07 pm    Post subject: Re: Rexx Find diff between times strings
Reply with quote

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
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us