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: 82
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: 82
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

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