I have 2 files.Need to compare these 2 file.IF the first 9 fileds are matching in both the file then i need to select certain fields from the 2 file and write that data of file2 into an output file.
file 2 can contain duplicate records.
ex:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT/ICETOOL job that will do what you want. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
With the new UK90007 Dfsort Ptf from April 2006, we are able to use INREC with SPLICE.
We can concatenate the files together with adding a separator between them. So we can apply a logic
to suppress a pass.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Actually, in this particular case, the simpler one pass version using INREC with SPLICE shown in the DFSORT/ICETOOL job below will work too. It's based on the assumption that both files have the same RECFM and LRECL, and that the first file can be distinguished from the second file by blanks in 16-17.