Please help with below senario
Posted: Thu Jun 16, 2011 12:58 pm
Hi Please help me out with a JCL for the following scenario:
File 1
123 aaaaaaaa 2010-05-06 fffff
123 aaaaaaaa 2010-04-06 ggggg
234 cccccccc 2010-07-09 kkkkk
456 dddddddd 2010-09-05 ppppp
456 dddddddd 2010-06-06 rrrrr
File 2
123 1998-09-08
123 1997-05-06
234 1996-07-08
456 1995-09-02
456 1994-01-01
The output file should be as follows:
Output:
123 aaaaaaaa 1998-09-08 fffff
123 aaaaaaaa 1997-05-06 ggggg
234 cccccccc 1996-07-08 kkkkk
456 dddddddd 1995-09-02 ppppp
456 dddddddd 1994-01-01 rrrrr
It should be noted that for the first occurance of the key in the file1 the first timestamp of file2 should be replaced. For the second occurance of the key in file1 second timestamp of file 2 should be replaced
File 1
123 aaaaaaaa 2010-05-06 fffff
123 aaaaaaaa 2010-04-06 ggggg
234 cccccccc 2010-07-09 kkkkk
456 dddddddd 2010-09-05 ppppp
456 dddddddd 2010-06-06 rrrrr
File 2
123 1998-09-08
123 1997-05-06
234 1996-07-08
456 1995-09-02
456 1994-01-01
The output file should be as follows:
Output:
123 aaaaaaaa 1998-09-08 fffff
123 aaaaaaaa 1997-05-06 ggggg
234 cccccccc 1996-07-08 kkkkk
456 dddddddd 1995-09-02 ppppp
456 dddddddd 1994-01-01 rrrrr
It should be noted that for the first occurance of the key in the file1 the first timestamp of file2 should be replaced. For the second occurance of the key in file1 second timestamp of file 2 should be replaced