I need to compare 2 files on first 5 bytes and get the matching records, both has duplicates in the key.
I don't want a cartesian product in the output. I need to do one to one matching. Since i use SYNCSORT i am unable to use NOSEQCK . Could some one help me accomplish this using SYNCSORT.
Basically I need 3 bytes starting from Position 6 of the second file to be replaced with 3 bytes from position 6 of the first file.
WIll always the second file have lesser number of duplicates? Show an example input and the expected output when there are,
1) 3 duplicate keys in file-2 and you have 2 duplicates in file-1
2) 3 duplicate keys in file-2 and no duplicates in file-1
3) 3 duplicate keys in file-2 and no key present in file-1
btw NOSEQCK is a DFSORT option, you may not be able to use it in Syncsort.
All the 3 scenarios mentioned by you are possible. In any case we need only matching records. So we can drop a record which does not have any match in the other file.
Here is the input and output format for the scenarios you have mentioned.