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

Two file match the records and write out file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pnsnaresh

New User


Joined: 16 May 2006
Posts: 7
Location: pune

PostPosted: Tue Jan 23, 2007 9:59 pm
Reply with quote

Hi,
I have 2 sorted files A and B(empid empname). now match record of A with B if matched write AB in C, unmatched write A in to D, Brecords not in A write in E.

input files : A,B
output files: C,D,E

needed program logic

Thanks in advance
Naresh
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Jan 29, 2007 1:56 pm
Reply with quote

Hi Naresh,

Please find logic below

IF Key of FILEA = Key of FILEB
Populate FILEC record using FILEA Record
WRITE FILEC
READ FILEA
READ FILEB
ELSE
IF Key of FILEA < Key of FILEB
Populate FILED Record using FILEA Record
WRITE FILED
READ FILEA
ELSE
Populate FILEE Record using FILEB Record
WRITE FILEE
READ FILEB
END-IF
END-IF.

Hope it will helpful
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Tue Jan 30, 2007 8:28 am
Reply with quote

You can do this using SORT ICETOOL.
search the forum in SORT/ICETOOL and you can find the solution.
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top