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
 
Subtract two timestamps

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

New User


Joined: 16 Apr 2008
Posts: 24
Location: pune

PostPosted: Thu Oct 16, 2008 1:35 pm    Post subject: Subtract two timestamps
Reply with quote

Hi,
i would like to subtract two timestamp:
e.g... diffrence = hh1.mm1.ss1-hh2.mm2.ss2
e.g. difference = 12.40.40 - 10.23.23
is there any direct function in cobol?
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Oct 16, 2008 4:00 pm    Post subject: Re: Subtract two timestamps
Reply with quote

You need to convert each timestamp (which must include at a minimum the Year, Month and Day, but a CCYYMMDD would be preferable) into seconds and then perform the subtraction.

Review the LE (Language Environment) Callable Service routine CEESECS and use this instead. It will keep you out of trouble and you'll always produce the correct result.

You can then use Callable Service routine CEEDATM to convert the resulting seconds into picture format.

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 Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Sort to subtract constant from variab... drarem DFSORT/ICETOOL 9 Wed Oct 21, 2015 1:08 am
No new posts JCL SORT - Subtract 2 Months from Cur... srinathds83 SYNCSORT 12 Mon May 12, 2014 12:57 pm
No new posts How to subtract 100 days from current... Logeshwari.Bai DFSORT/ICETOOL 3 Mon Mar 17, 2014 3:40 pm
No new posts Syncsort - subtract and copy using JO... ramsri JCL & VSAM 1 Fri Oct 18, 2013 5:38 pm

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