JCL SORT to compare and update a field in a file
Posted: Thu Feb 11, 2010 2:32 am
Hi All,
I have 2 sequential files.
File1 = length 80, File2 = lenght 133
File 1:
..... 111111........AAAAA...
......222222........BBBBB...
File2:
.. 333333........CCCCC...
.. 222222........DDDDD...
I want to compare the position 20:6 of file1 with column 25:6 of file2. If match is found then update column(50:5) in FIle1 with column(45:5) from File 2.
i.e after comparing the above 2 files, the File1 must be updated as below:
File 1:
..... 111111........AAAAA... <------NO CHANGE AS NO MATCH IN FILE 2
......222222........DDDDD... <------ BBBBB UPDATED TO DDDDD AFTER COMPARING WITH FILE2.
I have 2 sequential files.
File1 = length 80, File2 = lenght 133
File 1:
..... 111111........AAAAA...
......222222........BBBBB...
File2:
.. 333333........CCCCC...
.. 222222........DDDDD...
I want to compare the position 20:6 of file1 with column 25:6 of file2. If match is found then update column(50:5) in FIle1 with column(45:5) from File 2.
i.e after comparing the above 2 files, the File1 must be updated as below:
File 1:
..... 111111........AAAAA... <------NO CHANGE AS NO MATCH IN FILE 2
......222222........DDDDD... <------ BBBBB UPDATED TO DDDDD AFTER COMPARING WITH FILE2.