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
 

 

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: 4648
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: 10256
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am


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