Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
jaspal

New User

Joined: 22 May 2007
Posts: 68
Location: mumbai

Posted: Fri May 25, 2007 6:45 pm    Post subject: Calculate TIME difference after reading 2 files

I have to find difference between two times that are in HHMMSS

TIMEA-TIMEB

TIMEA WE WILL GET FROM FILE1 WHICH IS SAME ALL THE TIME SAY 11:36:24

TIMEB WE WILL GET FROM THE OTHER FILE IN WHICH ALL THE TIMES ARE DIFFERENT SAY
09:00:00
09:10:00
10:00:00
10:12:34

SO WE REQUIRE TO SUBTRACT TIMEB FROM TIMEA
AS LIKE THIS
 Code: TIMEA     - TIMEB        = TIMEC 11:36:24  - 09:00:00     = 02:36:24           - 09:10:00     = 02:26:24           - 10:00:10     = 01:36:14           - 10:12:34     = 01:23:50

WE HAVE TO MOVE TIMEC TO ARRAY SO THAT IT CAN BE MOVED TO TABLE

dick scherrer

Site Director

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

 Posted: Fri May 25, 2007 7:06 pm    Post subject: Hello, Convert the time hh.mm.ss to seconds only. Perform the calculation and convert back to hh.mm.ss.
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

 Posted: Fri May 25, 2007 7:35 pm    Post subject: Or use base60 math.......

New User

Joined: 03 Nov 2005
Posts: 43
Location: St.Louis

 Posted: Sat May 26, 2007 12:25 am    Post subject: I think any one of the above is fine.. if you checking for time differance in the same region (i mean time zone)
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us