Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 87
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: 87
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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us