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: 78
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: 8132
Location: East Dubuque, Illinois, USA

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: 757
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 editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm


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