In IN1, each record is unique (the whole record is unique key).
In IN2, we have as key a subkey of IN1 key format (4 first chars)
OUTPUT contains all IN1 records, but if an IN1 record has its subkey match the key of IN2, then the DATA field of the matching IN2 record has to be appended to the IN1 OUTPUT record.
I've tried with SPLICE, but it seems no option is adequate (WITHALL, KEEPNODUPS, KEEPBASE) nor copying the files to the temp file in one order or another.
The problem is that key2 is a subkey of key1. If key1 and key2 where the same, then I could do:
1) append IN2 to IN1. SPLICE on key WITHALL.
If I do this with our input files and SPLICING on key2, then records would be lost (aggregation of same subkey in IN1)