View previous topic :: View next topic
|
Author |
Message |
siva2 Warnings : 1 New User
Joined: 10 Feb 2006 Posts: 7
|
|
|
|
is it possible to copy duplicates from two files in to one file ?
if please leeme know how can it be done ? ?
file 1 :
abc
ddd
fff
file 2
eee
ddd
ggg
file 3
ddd |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input file1
// DD DSN=... input file2
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,3,CH) FIRSTDUP
/*
|
|
|
Back to top |
|
|
raam_kumar
New User
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
|
|
|
|
I think it would be better if we use
SELECT FROM(CON) TO(OUT) ON(1,3,CH) ALLDUPS
instead of
SELECT FROM(CON) TO(OUT) ON(1,3,CH) FIRSTDUP
Please correct me if i am wrong |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Raam,
You're wrong and you could have corrected yourself if you had just tested what you proposed.
Siva2 stated that the output should be:
ddd
With FIRSTDUP, the output is:
ddd
as requested.
With ALLDUPS, the output is:
ddd
ddd
which is NOT as requested.
In the future, I'd suggest you test your solution before posting, especially if you're going to "correct" the person who "invented" the tool (ICETOOL) being used. |
|
Back to top |
|
|
|