View previous topic :: View next topic
|
Author |
Message |
manugeorge2004
New User
Joined: 17 Jun 2009 Posts: 38 Location: Denver
|
|
|
|
Hi
I have a COBOL teradata program. The input file has a time field.
I need to execute a query on a teradata table using a BETWEEN clause within plus or minus 5 minutes. Teradata dont have the capability to have MINUTES in WHERE clause. I was thinking I can do this in COBOL code itself.
Do we have a COBOL function to add or subtract 5 minutes from a working storage variable which has time data. If not, do we have a teradata function to do this
Your help is appreciated |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I recommend that you investigate the Language Environment functions CEELOCT (get local date and time) and CEESECS (convert timestamp to seconds). |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
You must consider being on or close to a Midnight boundary, where the five minute difference to/from could be the next day, next month, next year or next century.
This is why Akatsukami's suggestion is germane.
Based upon a start date of January 1, 1900 at 00:0:00, Y2K date of 2000/01/01 at 00:00:00 equals 3155673600 milliseconds.
Mr. Bill |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Oops - a correction to my previous post. The millisecond value for 2000/01/01 - 00:00:00 is 3155673600000.
Mr. Bill |
|
Back to top |
|
|
|