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
 

 

Subtracting time in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
manugeorge2004

New User


Joined: 17 Jun 2009
Posts: 35
Location: Denver

PostPosted: Fri Aug 26, 2011 9:52 pm    Post subject: Subtracting time in COBOL
Reply with quote

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
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Fri Aug 26, 2011 10:01 pm    Post subject:
Reply with quote

I recommend that you investigate the Language Environment functions CEELOCT (get local date and time) and CEESECS (convert timestamp to seconds).
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Aug 26, 2011 10:21 pm    Post subject: Reply to: Subtracting time in COBOL
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Aug 27, 2011 1:08 am    Post subject: Reply to: Subtracting time in COBOL
Reply with quote

Oops - a correction to my previous post. The millisecond value for 2000/01/01 - 00:00:00 is 3155673600000.

icon_redface.gif icon_redface.gif icon_redface.gif

Mr. Bill
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 -> COBOL Programming 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 How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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