View previous topic :: View next topic
|
Author |
Message |
srinu14165 Warnings : 1 New User
Joined: 19 Jul 2006 Posts: 8
|
|
|
|
Hi,
I have 2 files and the requirement is that I need to sort out all the unmatched records from 2 files based on the all records in the input file.
rest to sure that I want only the unmatched records from the I/P file-2 only in the output.
Like for Eg:
I/p file -1
aaaabbbcccc1
dddddeeeeff2
I/P file-2
dddddeeeee2
aaaabbbcccc1
cccggghhhhh2
O/P file
cccggghhhhh2
Can anybody help me out
Thanks
Sri |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
In your limited example, you show no duplicates within file1, no duplicates within file2, and no records in file1 that don't have a match in file2. I can give you a simple solution for that case, but I suspect you'll come back and say "but that didn't work for this other situation". So:
1) Can file1 have duplicates within it, e.g.
I/P file - 1
aaaabbbcccc1
dddddeeeeff2
aaaabbbcccc1
2) Can file2 have duplicates within it, e.g.
dddddeeeee2
aaaabbbcccc1
cccggghhhhh2
aaaabbbcccc1
3) Can file1 have a record that is not in file2, e.g.
I/p file -1
aaaabbbcccc1
dddddeeeeff2
xxxxxxxxxxx
I/P file-2
dddddeeeee2
aaaabbbcccc1
cccggghhhhh2
If any of these situations are possible, then please show a more complete example of the records in the input file and what you want for the output records that covers all of the possible variations.
Also, state the RECFM and LRECL of the input files. |
|
Back to top |
|
|
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
For all the Scenarios listed by Frank EZtreive will be a easy Solution.
Check with ur team if anyone is using EZtreive or search forum for more details.
In my previous Project I used for matching/unmatching records, I will try to get some samples. |
|
Back to top |
|
|
senman
New User
Joined: 17 Aug 2006 Posts: 17 Location: Chennai
|
|
|
|
Try this
//STEP010 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A7105AB.INPUT1,DISP=SHR
// DD DSN=A7105AB.INPUT2,DISP=SHR
/*
//SORTOUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,12,ZD) NODUPS
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
But I have a doubt if your i/p is typed wrongly... pls check |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
This won't work since the data is alphanumeric. CH or BI would work. But again, this only works for the case where there are no dups within file1, no dups within file2 and no records in file1 that don't have a match in file2 which is what I was trying to verify.
Quote: |
//SYSOUT DD SYSOUT=*
|
This DD isn't needed and is ignored.
Quote: |
But I have a doubt if your i/p is typed wrongl |
I agree. dddddeeeeff2 in file1 does not actually match dddddeeeee2 in file2, but was probably meant to. |
|
Back to top |
|
|
|