You are here:

Cobol/Time calculations

Advertisement


Question
Hi,
I am trying to do a calculation with time and can not find anything on the subject.  Is there a function or program that I can call that will find the difference between two times?

Thanks

Answer
Regular COBOL does not have a TIME function set.
However, it is not difficult to create your own function set.  You need to define what functions / features you need to support.  Are you going to include DATE with the time?  There is support for DATE differences via the FUNCTION list with both JULIAN and GREGORIAN date support.

If you are dealing with a database, most of them support some format of time difference.

Hope this helps.

Happy coding.

David  

Cobol

All Answers


Answers by Expert:


Ask Experts

Volunteer


David Nelson

Expertise

I specialize in IBM z/OS COBOL and MicroFocus OCDS and Server Express non-OOP. Design, coding and performance oriented questions. Also linking to IBM Assembler from COBOL. Because the rules change with version, please state language level, version and platform environment. See CICS for questions about CICS.

Experience

Over 30 years working with COBOL on multiple platforms and OS.

Education/Credentials
Graduate, New York School of Computer Technology.

Past/Present Clients
Major Financial Institutions, State of NC (DHHS), Manufacturing, Financial services, Warehousing, Software developer and others.

©2012 About.com, a part of The New York Times Company. All rights reserved.