Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File match & merge

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
maxsubrat

New User


Joined: 27 Feb 2008
Posts: 72
Location: india

PostPosted: Tue May 12, 2009 4:35 pm    Post subject: File match & merge
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: 7931
Location: Bellevue, IA

PostPosted: Tue May 12, 2009 4:56 pm    Post subject:
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: 743
Location: Germany

PostPosted: Wed May 13, 2009 3:08 pm    Post subject:
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

Senior Member


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

PostPosted: Thu May 14, 2009 2:20 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us