Can someone please help me with a unix logic for below. I tried to get the desired output by using change capture condition in Datastage but its not working properly. i have two files file1, file2 as below.
file1
HTML Code:
ROW_NO VEND_NO CODE AIR_D OCEAN_D
----------------------------------------
1 5000315 CPT 01-JAN-00 20-JUN-09
2 5000315 DUR 01-JAN-00 23-JUN-09
3 5000004 DUR 24-JUN-09 24-JUN-30
4 5000004 CPT 19-JUN-09 24-JUN-09
5 5000202 RTM 31-DEC-98 21-MAY-01
6 5000175 KEE 01-JAN-00 01-MAY-97
file2
HTML Code:
VEND_NO CODE AIR_D OCEAN_D
----------------------------------
5000004 DUR 24-JUN-09 24-JUN-30
5000315 DUR 01-JAN-00 23-JUN-20
5000202 RTM 31-DEC-13 21-MAY-15
5000175 KEE 01-JAN-00 01-MAY-97
5000004 CPT 19-JUN-00 24-JUN-14
5000203 MBA 30-DEC-98 16-JUN-00
5000315 CPT 01-JAN-10 20-JUN-20
For a combination of VEND_NO, CODE values in every row in file1, have to compare AIR_D, OCEAN_D values in file1 with the values in file2 for the same combination of VEND_NO, CODE values. if there is a mismatch, need to replace with the values found in file2. For example, for the combination of VEND_NO=5000315, CODE=CPT in file1, when comparing AIR_D,OCEAN_D values in file1 with file2, there is a mismatch. so these two values should be replaced. output should be as below.
HTML Code:
ROW_NO VEND_NO CODE AIR_D OCEAN_D
----------------------------------------
1 5000315 CPT 01-JAN-10 20-JUN-20
2 5000315 DUR 01-JAN-00 23-JUN-20
3 5000004 DUR 24-JUN-09 24-JUN-30
4 5000004 CPT 19-JUN-00 24-JUN-14
5 5000202 RTM 31-DEC-13 21-MAY-15
6 5000175 KEE 01-JAN-00 01-MAY-97