Merge and eliminate duplicates using Easytieve



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Merge and eliminate duplicates using Easytieve

Postby gauravuppal11 » Thu Mar 14, 2013 11:27 pm

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.
gauravuppal11
 
Posts: 18
Joined: Thu Mar 14, 2013 11:18 pm
Has thanked: 2 times
Been thanked: 0 time

Re: merge and eliminate duplicates

Postby dick scherrer » Sun Mar 17, 2013 2:58 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: merge and eliminate duplicates

Postby gauravuppal11 » Mon Mar 18, 2013 9:43 pm

Thanks for the response, I will try the eazytrieve one out.
What do you mean by a COBOL sticky
gauravuppal11
 
Posts: 18
Joined: Thu Mar 14, 2013 11:18 pm
Has thanked: 2 times
Been thanked: 0 time

Re: merge and eliminate duplicates

Postby Akatsukami » Mon Mar 18, 2013 10:05 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: merge and eliminate duplicates

Postby gauravuppal11 » Mon Mar 18, 2013 10:12 pm

thanks a lot , i will take a look at it.
gauravuppal11
 
Posts: 18
Joined: Thu Mar 14, 2013 11:18 pm
Has thanked: 2 times
Been thanked: 0 time


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post