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

write records to output file after comparing 2 input files


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: Thu May 07, 2009 7:53 pm
Reply with quote

Hi,
I have 2 input flat files and 1 output file..
the file formats are like that:
file 1:
111 rama xxxx
222 shyam cccc
333 gopala vvvv
555 hari bbbb

file 2:
123 hasim rrrr
222 shyam cccc
456 ramesh kkkk
666 nilam iiii
555 hari bbbb

My output file should be like that:

output:
111 rama xxxx
222 shyam cccc
333 gopala vvvv
555 hari bbbb
123 hasim rrrr
456 ramesh kkkk
666 nilam iiii

Could someone tell me the logic i need to use it in the cobol program only..
Thanks
Back to top
View user's profile Send private message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Thu May 07, 2009 8:32 pm
Reply with quote

adding to the above: it is just like DB2 union type...
combining 2 files to the 3rd one without duplicate..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 07, 2009 9:05 pm
Reply with quote

Hello,

Why does 123 not follow 111 in the output?

If you properly sort the 2 files by the "key" you can download the 2-file match/merge example code from the "Sticky" near the top of the cobol part of the forum.

The code there will do what you want with very minor modification.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top