I have 2 FILES and I need to overlay only one field of 2 byte length from FILE A to FILE B under some IF (KEY) conditions.
My FILE A has RECFM as FB and LRECL as 104. My FILE B has RECFM as FB and LRECL as 210. My Output file also has RECFM as FB and LRECL as 210.
My FILE A has keys starting from position 41 to a length of 28 bytes. So the end position is 68 in my FILE A.
My FILE B has keys starting from position 30 to a length of 28 bytes. So the end position is 57 in my FILE B.
I want to compare the KEYS from FILE A to FILE B. My FILE A will have unique records whereas the FILE B has duplicate keys. So I want to overlay all the duplicates in FILE B. There are also chances where the records present in FILE A need not be present in FILE B, So we need not worry about those. We need to consider only if there is any matching records for the keys from both FILE A and FILE B, then we need to take the record in position 37 to 38 (Length of 2 byte) from FILE A and need to overlay in FILE B in position 209 to 210 (Length of 2 byte). I also need the unmatched records from only FILE B to Output. Please find the sample example below
In the above requirements please add the following as well. In FILE A, I have only 700 records whereas the in FILE B i have 32000. I want to match each key present in FILE A to all the 32000 records present in FILE B and whereever the match found. We need to overlay with the 2 byte field from FILE A (position 37 - 38) to FILE B (Position 209 - 210).