There are lots of posts on file comparision , however I could not find any to satisfy my needs, hence this post.
I have to compare two sequential files omitting some fields from the comparison ( the fields to be omitted may not be in sequence) and if difference is found report the key( which is first four characters of File A and the starting and if possible the ending position of the record.
For example :
The input file is FB and LRECL is 80. The fields to be not considered for comparison lie between 6 to 7 and 11 to 14.
A sample FileA record is as :
Sample FileB record is as :
After the comparison the output report should look like :
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
If i understood what is needed, it is a report of the starting and ending position of "the mismatched data" after matching the records on the "keys".
I don't believe the mismatch would always be in the same positions. I'm also not sure what should happen if there is more than one set of characters that don't match. From the small amount of sample data it is difficult to guess.
Hence, the suggestion to write code and make the output be whatever is required.