Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Subtract two timestamps

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
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
References
Bill O'Boyle

Senior Member


Joined: 14 Jan 2008
Posts: 368
Location: Orlando, FL, 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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1