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
 

 

Time math in REXX. Are there time math functions?

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

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

PostPosted: Sun Apr 12, 2009 10:41 pm    Post subject: Time math in REXX. Are there time math functions?
Reply with quote

I need to do some math on time fields using REXX. Are there time math functions or do I need to create my own? I need to do stuff like compare two time strings and calculate the time difference, add minutes to a time string, et al.

I search the rexx and clist forum here for 'TIME' and got no hits. I googled a bit and only saw example of how to get the current time and elapsed time but not how to do time math.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Apr 12, 2009 11:25 pm    Post subject:
Reply with quote

Hi,

I'm not a rexx expert, however a little search gives this simple example to calculate the hours:
Code:
/* rexx */
date1 = '12 Oct 2006'
time1 = 9
/* use "date2 = DATE()" for current date */
date2 = '13 Oct 2006'
/* use "time2 = time('H')" for current time */
time2 = 11

date1 = DATE('B',date1)
date2 = DATE('B',date2)
datediff = date2 - date1 - 1
hourdiff = 24-time1+time2
hourdiff = hourdiff + 24*datediff
say hourdiff
Back to top
View user's profile Send private message
jasorn

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

PostPosted: Mon Apr 13, 2009 9:11 am    Post subject:
Reply with quote

Anuj,
Thanks for replying. I should have mentioned I have routines for time math I could implement but wanted to know if there were functions built in I was missing before I used them. I used them for now but will check with the rexx folks at work and see what they use.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 13, 2009 1:36 pm    Post subject:
Reply with quote

If the function exists it will be in the manual. Have you looked.
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm


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