Page 1 of 1

Merge and eliminate duplicates using Easytieve

PostPosted: Thu Mar 14, 2013 11:27 pm
by gauravuppal11
Hi,
I have a query regarding merging files into one

I have two variable record size files FILEA and FILEB with key from position 15 to position 113.
Both the files can contain duplicates on the key.

I want to merge these two files ( write all records of both file) into one file but if there are duplicates present on the key, i want to write the records ONLY from filea.

How can i do this using easytrieve.

Re: merge and eliminate duplicates

PostPosted: Sun Mar 17, 2013 2:58 am
by dick scherrer
Hello,

There are 2 ways to do this shown in the forum.

1. there is a COBOL Sticky that performs a 2-file match/merge (what you are looking for). This same approach may be used in Easytrieve.

2. There is a MATCHED function in Easytrieve. Look at the manual or search n the forums for Google or an example.

Re: merge and eliminate duplicates

PostPosted: Mon Mar 18, 2013 9:43 pm
by gauravuppal11
Thanks for the response, I will try the eazytrieve one out.
What do you mean by a COBOL sticky

Re: merge and eliminate duplicates

PostPosted: Mon Mar 18, 2013 10:05 pm
by Akatsukami
If you browse the IBM Cobol forum, at the top you will see a thread labeled "2-file match/merge sample code by dick scherrer ยป Wed Jul 30, 2008 1:48 pm". The unique icon iindicates that this thread is "sticky" -- that it will remain at the top of the list of threads no matter old the last post in it is. If you open this thread, you will see that Mr. Scherrer has attached the COBOL code to the first post as a downloadable file.

Re: merge and eliminate duplicates

PostPosted: Mon Mar 18, 2013 10:12 pm
by gauravuppal11
thanks a lot , i will take a look at it.