View previous topic :: View next topic
|
Author |
Message |
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
Hi,
My requirement is:
I have 2 input file and i need to process these 2 input file. finally write it to the output file.
To elaborate:
1.suppose file1 has 6 records and 3 records are duplicate and file 2 has 4 records and 2 records are duplicate.
2. There are 1 record similar(duplicate) in file 1 and file2.
so i need to eliminate all the duplicate in these 2 files by comparing file1 and file2, then comparing the file itself..
can someone tell me the logic.
file1:
Emp No. Employee name sal
001 john 2000
003 molly 5000
003 sitesh 3000
003 harison 2500
007 robinson 1000
009 george 5000
----------------------
file2:
Emp No. Employee name sal
002 Bill 2000
002 Bill 2000
007 robinson 1000
013 Vinod 2500
-----------------
File3:My output file should be:
Emp No. Employee name sal
001 john 2000
002 Bill 2000
003 molly 5000
007 robinson 1000
009 george 5000
013 Vinod 2500
------------------------------------------ |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What have you coded yourself so far? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Morning Sir !
You could achieve this by using Sort-Utility.
First sort file-01 and eliminating duplicates.
Then same with file-02.
Alt last sort file-01 with file02 and eliminating duplicates. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
There is a sticky on "2-File Match/Merge" with the name "2-File Match/Merge sample code" in "Mainframe COBOL" part of the forum -- download the code, work through it and try to adjust as per your needs . . . and then post us back with what you have done. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
You s/b able to do a SORT COPY with SUM FIELDS=NONE and concating the 2 I/P files.
P.S. But I have a feeling there's a lot of detail we haven't gotten.
Sorry, the "SORT COPY" above s/b "SORT on the key sequence you want the data to be in"; that is, the DUPs you're trying to eliminate. |
|
Back to top |
|
|
|