Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
David,
Welcome to the wonderful world of DFSORT.
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed, as in the example you showed, that you do not have any duplicates on the two keys within file1, or within file2.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Note that the Smart DFSORT Trick Dick refers to is a general example that uses SPLICE to create three different files - one with the records found only in file1, one with the records found only in file2, and one with the records found in file1 and file2.
This is a simpler case - one output file with the records found only in file1 - so we can use the simpler solution shown with SELECT instead of SPLICE.
Notice there are no spaces before OUTFIL and an '=' after it. This is not the correct syntax and, in fact, DFSORT treats the entire statement as a label and ignores it. You need to change your OUTFIL statement to:
Though my problem is solved, but I would like to know what if the
input file 1 has duplicates on the key positions mentioned above and I want to have all the records (including duplicates) of input file 1 which are not present in input file 2.
I tried to look into the manual and also the links provided in this post, couldn't find any.
I want to get the out put as records which are in file 1 only but it should also have all the duplicates also from file 1.
out put should look like:
ABCDAAA4445011500001047 XXXXXXXXXXXXXXXXXXXXXX
ABCDAAA4445011500001047 XXXXXXXXXXXXXXXXXXXXXX
ABCDAAA4445011500001047 XXXXXXXXXXXXXXXXXXXXXX
Record length and keys positions for the files mentioned as before.