View previous topic :: View next topic
|
Author |
Message |
Sivagurunathan Jagadeesan
New User
Joined: 06 Mar 2007 Posts: 32 Location: India
|
|
|
|
I am working on Enterprise COBOL. I would like to know if there is any COBOL Function which I can add/subtract variables that hold Time (HH:MM:SS) of the day.
Siva |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I'm not aware of "time arithmetic" in COBOL directly.
Check out this from another source:
Quote: |
DB2 provides the capability to add and subtract DATE, TIME, and TIMESTAMP columns. Keep in mind the following rules:
-both operands must be of the same data type (ie, both dates or both times)
Example: CURRENT DATE - 1 MONTH or CURRENT DATE + 1 DAY
-if one operand is a timestamp, the other operand can be a time or a date, but not a timestamp.
Example: TIMESTAMP + 1 DAY or TIMESTAMP - 24 HOURS
-date durations are expressed as DECIMAL(8,0). The valid date durations are:
DAY, MONTH, and YEAR and their plural equivalents.
-time durations are expressed as DECIMAL(6,0). The valid time durations are:
HOUR, MINUTE, SECOND, and MICROSECOND and their plural equivalents.
|
Several places i've been, there was a callable routine that provided time addition and subtraction. You might write your own if DB2 will not meet your requirement. |
|
Back to top |
|
|
Sivagurunathan Jagadeesan
New User
Joined: 06 Mar 2007 Posts: 32 Location: India
|
|
|
|
Hi,
Thanks a lot, DB2 would best suit me, when there is no Intrinsic function in COBOL.
Thanks,
Siva |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome |
|
Back to top |
|
|
|