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

Author Message
jasorn

Active User

Joined: 12 Jul 2006
Posts: 154
Location: USA

 Posted: Sun Apr 12, 2009 10:41 pm    Post subject: Time math in REXX. Are there time math functions? 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.

Anuj Dhawan

Senior Member

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

Posted: Sun Apr 12, 2009 11:25 pm    Post subject:

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
jasorn

Active User

Joined: 12 Jul 2006
Posts: 154
Location: USA

 Posted: Mon Apr 13, 2009 9:11 am    Post subject: 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.
expat

Global Moderator

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

 Posted: Mon Apr 13, 2009 1:36 pm    Post subject: If the function exists it will be in the manual. Have you looked.
 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 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 Merging records, but not all the time prino DFSORT/ICETOOL 17 Sat Feb 17, 2018 4:20 pm

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