IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Subtract two timestamps


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Oct 16, 2008 4:00 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Subtract the ZD fields to provide neg... DFSORT/ICETOOL 4
No new posts Compare two files and subtract values DFSORT/ICETOOL 7
No new posts Sort to subtract constant from variab... DFSORT/ICETOOL 9
No new posts JCL SORT - Subtract 2 Months from Cur... SYNCSORT 12
No new posts How to subtract 100 days from current... DFSORT/ICETOOL 3
Search our Forums:

Back to Top