Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Arithmetic between Variables containing Time

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

New User


Joined: 06 Mar 2007
Posts: 32
Location: India

PostPosted: Wed Mar 07, 2007 7:50 am    Post subject: Arithmetic between Variables containing Time
Reply with quote

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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 9:05 am    Post subject:
Reply with quote

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

New User


Joined: 06 Mar 2007
Posts: 32
Location: India

PostPosted: Wed Mar 07, 2007 2:48 pm    Post subject: Arithmetic between Variables containing Time
Reply with quote

Hi,

Thanks a lot, DB2 would best suit me, when there is no Intrinsic function in COBOL.

Thanks,
Siva
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 10:35 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif
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
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 5 Sat May 06, 2017 12:59 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us