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.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
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.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
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.
output 1 - matched records from file1
output 2 - matched records from file2
output 3 - unmatched records of input file1
output 4 - unmatched records of input file2
We need to sort based on the key 14,20.
File1 will not have duplicates and file2 may have duplicates also.
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
Please stop saying JCL when, in fact, you mean 'sort control cards/records'. Sort control cards are NOT JCL - they are sort control cards. You will not find them in the JCL manual.
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.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Harish,
Also while posting error messages from an ICETOOL step, remember that the actual error messages that could hint what might have gone wrong would be present only in your TOOLMSG/DFSMSG outputs.