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
 

 

write records to output file after comparing 2 input files

 
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: Thu May 07, 2009 7:53 pm    Post subject: write records to output file after comparing 2 input files
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

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Thu May 07, 2009 8:32 pm    Post subject:
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

Site Director


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

PostPosted: Thu May 07, 2009 9:05 pm    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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