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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: compare two files and write dupicates into first file....
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

Site Director


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

PostPosted: Sun Jun 14, 2009 10:32 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Sep 16, 2009 2:51 pm    Post subject: Reply to: compare two files and write dupicates into first f
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    Post subject: I am not understading u r logic
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

Site Director


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

PostPosted: Wed Sep 16, 2009 9:17 pm    Post subject:
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    Post subject:
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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