View previous topic :: View next topic
|
Author |
Message |
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Dear all,
I want to merge 2 file for ex fil1,fil2 which is having following input
fil1
98765432
34567891
11111111
22222222
fil2
11111111
22222222
and the output should be
outfil
11111111
22222222
Regards,
Murali. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
I didn't understand why did you use the term "Merge", ouput shown is actually the common records between two files. Before someone go ahead with further suggestions, please clarify what exaclty you are looking for. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
And supply record formats, record lengths, and key positions. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Can input file1 have duplicates within it?
Can input file2 have duplicates within it?
If either file can have duplicates within it, show that in your example of input records and expected output records. |
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Hi Frank,
Both input & output doesn'y have duplicates.
Regards,
Murali. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Murali,
You haven't given a lot of information. Assuming you want the records from file1 that have a match in file2, you can use a DFSORT/ICETOOL job like this:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD * input file1
98765432
34567891
11111111
22222222
// DD * input file2
11111111
22222222
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,8,CH) FIRSTDUP
|
|
|
Back to top |
|
|
|