IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File match & merge


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Tue May 12, 2009 4:35 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 12, 2009 4:56 pm
Reply with quote

What have you coded yourself so far?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed May 13, 2009 3:08 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu May 14, 2009 2:20 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri May 15, 2009 3:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top