Page 1 of 1

Adding Time fields

PostPosted: Mon May 28, 2012 1:15 am
by ibmmf4u
Hi Everyone,

My requirement goes this way. I would like to add two time fields present in two different files based on join key present in both the files. And would like to move the resultant obtained as per the match keys into an other file and the one that doesn't match with the file2 into one more file. Below mentioned is an example of the same.

File1:-
TEST1     23:53:02
TEST2     22:10:02
TEST3     20:08:02
TEST4     21:09:04



File2:-
TEST1    00:07:58
TEST2    00:08:58
TEST3    00:09:58
TEST5    00:10:58


Where in the File1 contains the time in 24hr format and File2 just contains only mins and sec's basically the time i.e to be added. The output files should be displayed below.

Match file:-
TEST1   00:01:00
TEST2   22:19:00
TEST3   20:18:00


Unmatch file:-


Can some kindly provide me the sort card in achieving the above.

Re: Adding Time fields

PostPosted: Mon May 28, 2012 7:17 am
by dick scherrer
Hello,

What should happen when the times are 2 daya apart?

What should happen when dat2 is less that date one (due to some error).

Once you have defined all of the rules (we can't do this as they are your local rules), suggest you convert the values to seconds, subtract, and convert the result back to (dd?) hh mm ss.

If you get stuck creating the "sort card" post what you have tried and where you are stuck. Soneome shouldbe able to help.