IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rexx Find diff between times strings


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Jan 24, 2008 7:58 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 24, 2008 8:08 pm
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
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: 1702
Location: Australia

PostPosted: Wed Jan 30, 2008 7:01 am
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: 194
Location: India

PostPosted: Wed Jan 30, 2008 12:07 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top