I have two files file1 with 424 and file2 with 714. sort key is starts from 14 with length 20. I want to generate four reports out of these two files.
1.The first report should have matching records from first file.
2.The second report should have matching records from second file.
3.The third report should contain records that exist only in first file and not in second file.
4.The fourth report should contain records that exist only in the second file and not in the first file.
Thanks in advance.
I have searched in the web only three reports logic is present but my requirement is to 4 reports. The main thing i am not sure how to compare different length files.
If you can find examples of three reports, surely adding another should not be difficult?
Matching records with different lengths is easy. If the "excess bytes" on the longer record are not blanks, then the files do not match. That's what we can say about it.
Now, in reality, you have to find out, and mention here, how the comparison is to be done. What is there that needs to be compared to show "match" or "not". It can be as little as the key, or as much as every byte on the short record having to match a particular byte, somewhere, on the long record.
You have not explained how you want to do the match.
Your JCL and Control Cards that you have shown are very far from anything you have described. You need to look up the messages to see what the obvious problem is, even though you need to start from scratch, most likely.
There are no reports in what you have shown. Explain, please, what you mean by reports.
Are you using DFSORT (ICE messages) or SyncSort (WER messages)?
You probably want to use JOINKEYS.
You need to be clear, in answering Arun's question, whether the data is already in key order, or whether you need to get it into key order for the comparison.
Only has two output files, but you should get the idea.
To determine where a record is present on the JOIN, a field which is know cannot possibly, ever, at all, be a chosen value (default is space) which you can specify on the FILL=
Have a look at this, and other examples, see what you can come up with, and let us know what you've tried if you encounter problems. The duplicates on File 2 should be your biggest problem, but since you've not said what output you want in the situation, that's the hints for now.