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

compare two files and write dupicates into first file....


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Sun Jun 14, 2009 9:28 pm
Reply with quote

HI,
i have two KSDS files like below,

file1,

aaaaaaaaaaaaaa
bbbbbbbbbbbbbb
cccccccccccccccc

file2,

eeeeeeeeeeeeee
aaaaaaaaaaaaaa
bbbbbbbbbbbbbb

i want to compare these two files and write the duplicate records alone in file1....means output like below,

file1,

aaaaaaaaaaaaaa
bbbbbbbbbbbbbb

can any one help me...................?
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: Sun Jun 14, 2009 10:32 pm
Reply with quote

Hello,

Near the top of this cobol part of the forum is a "Sticky" for a 2-file match/merge.

It is working code that with very minor modifications will do what you need.

Right-click on the attachment, save it to your pc, and upload it to your mainframe.

I'll not have an internet connect for the next few days, but will check back when i return.
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Mon Jun 15, 2009 1:20 pm
Reply with quote

Thanks for your reply....i will check that one and get back to you.
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Mon Jun 15, 2009 10:08 pm
Reply with quote

i have managed to write the program and it is working fine............thanks for your code.
Back to top
View user's profile Send private message
kunasatheesh

New User


Joined: 27 Sep 2007
Posts: 6
Location: Hyderabad India

PostPosted: Wed Sep 16, 2009 2:48 pm
Reply with quote

Hi Senthil,

Can u please forward that code to me...

Thanks in advance.

edited to remove the email address
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 16, 2009 2:51 pm
Reply with quote

Quote:
Can u please forward that code to me..


repeat on
Near the top of this cobol part of the forum is a "Sticky" for a 2-file match/merge.

and do not post email addresses
Back to top
View user's profile Send private message
kunasatheesh

New User


Joined: 27 Sep 2007
Posts: 6
Location: Hyderabad India

PostPosted: Wed Sep 16, 2009 3:30 pm
Reply with quote

I m new to COBOL...previously worked for PL1....I m not understanding ur logic...can u brief it...
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: Wed Sep 16, 2009 9:17 pm
Reply with quote

Hello,

Quote:
I m not understanding ur logic
What is not clear? If you are more specific about your doubt, someone will be able to clarify.

Suggest you "play computer" with the code and walk some data (make up 2 sets of keys that resemble your requirement) thru the code by hand.

Simply said, the code processes the data in both files syncronized on the key. For the code to work, both files must be in the key sequence.
Back to top
View user's profile Send private message
sudhakarreddy.ibm
Warnings : 1

New User


Joined: 20 Apr 2009
Posts: 15
Location: chennai

PostPosted: Fri Sep 18, 2009 5:03 pm
Reply with quote

Hi senthil,

I have a doubt regarding data in vsam file.Data is always sorted order in ksds file. I think, what the data you are mention in example is wrong.


Please correct me if i am wrong?


thanks
sudhakar
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 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top