Please show an example of the records in each input file and what you expect for the output records. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. Also, give the RECFM and LRECL of each input file.
Do you want to compare the records on positions 13-143 or on some other positions?
I don't think you understood what I meant when I asked "if file1 can have duplicates within it". I don't mean duplicates between file1 and file2 (I know you have those) - I mean when you look at just file1, does it have duplicate records within it. Likewise for file2. I also asked you to "show an example of the records in each input file and what you expect for the output records". You only showed one record for each file. That doesn't help much. Please show an example with enough records in each input file to show all the variations you expect (matching records, non-matching records, duplicate records within file1 (if any), duplicate records within file2 (if any), etc. And show the expected output records.
Depending on what exactly your input records look like and what you want for output, you may need to use the SELECT or SPLICE operators of DFSORT's ICETOOL, so in order to help you, I need to understand in detail what you're trying to do.
Alternatively, you can see if the "Create files with matching and non-matching records" Smart DFSORT Trick will do what you want:
If you could notice the first 3 records in both the file are not matching with respect to 4'th coloumn(also the last 4 cols).
That seems to be true for the first 4 records.
I can't figure out what you want for output. Do you want one output file or three output files?
First o/p :I need to check from 13-143. any mismatch in this section record from file1 should be the o/p.
What does this mean? You want a record from file1 that does not have a match in file2 on 13-143 in output file1? How is that different from:
Second o/p :The records present only in file -1
I asked you to show the expected output records, but you didn't. That probably would have helped me understand what you want.
I suspect that some variation of the first trick in the "Create files with matching and non-matching records" Smart DFSORT Trick will do what you want. But I can't show you how to do it exactly unless you can make it clear what you want to do.
Records present only in File - 1 (i.e no matching records in File-2 based on 1-13)
Records present only in File - 2 (i.e no matching records in File-1 based on 1 -13)
What does this mean? You want a record from file1 that does not have a match in file2 on 13-143 in output file1?
Exactly but based on 1-13.
First Check is 1-13 if both the files are same then
Second check is 13-143 should be same.
if 13-143 is same then go to next record
Write the record (from file-1) as unmatched record(1 record for each unmatched condition)
check if record only file-1
if yes.. write record in second o/p
write record in third o/p
Hope you could help me using sample code.