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: 1771
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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