Hi,
Thanks for the help with my last problem.
Now I have a new problem.
I need to compare 2 files and output records from file 1 that appear in file 2 as well.
File 1 contains duplicates. The output file needs to contain these duplicate records.
I also need to append the data from the matching record on file 2 to all the matching records in file 1.
Here is an example of what I need to do.
File 1
1234Aaron
1234Peter
1234Geoff
2345Adam
3456Paul
4567Trevor
4567David
5678Alan
File 2
1234Chessell
2345Richards
3456Galvin
5678Jones
6789Edwards
Output file
1234Aaron Chessell
1234Peter Chessell
1234Geoff Chessell
2345Adam Richards
3456Paul Galvin
5678Alan Jones
Specific file details include:
Match on a binary 4 field.
Record lengths and formats are different for each file: File 1 LRECL=92, File2 LRECL=14, however both have a binary 4 as the first field in each file. The output file has a LRECL=102 (basically the length of both records minus the key from file 2).
Any help would be much appreciated.
Regards,
Aaron