Pulling out the records which are same in two records

I have two files and I want to compare those two records ,after comparing I want to pull out the records which are same in both records and I want the new record from the unmatched records
record format is like this:
decimal(3) CUST_ID;
string(6) CUST_NAME;
string("
") ADDRESS;

same for two files;
and my records are
01 sidhu hyd
02 phani bng
03 hasnu che
04 azeem vtm
second file records are
01 sidhu che
02 phani bng
03 hasnu bng
04 azeem hyd
so I want now how to compare these two records and how can I get the file two record in my output by comparing these two files

Questions by Azeemuddin2204

Showing Answers 1 - 35 of 35 Answers

Sathya

  • Mar 24th, 2013
 

Use Full outer join. Match the key using name and you can pull the matching and unmatched records

  Was this answer useful?  Yes

SRILAKSHMI

  • Nov 12th, 2013
 

this not working above scenario tried this ,Use Full outer join. Match the key using name and you can pull the matching and unmatched records.

Full outer or inner join u take key is null and u can pull all the records..

  Was this answer useful?  Yes

Partition the datasets on cust_id and sort the smaller dataset with cust_id (should fit in memory if not remove the unwanted fields) and join the datasets with larger dataset as driving input extending the keys you want to match on including the cust_id. The out will give you all the matching. The unused0 will give you the updates the unused1 will give you all the records which are not needed to be updated(Trash)

  Was this answer useful?  Yes

mitesh

  • Jan 21st, 2014
 

You can use dynamic diff graph and ab-initio utility

  Was this answer useful?  Yes

Munmun

  • Feb 6th, 2014
 

Use inner join and key will be all fields. Now collect out, unused0 and unused1 port in a gather component and write it to the file.

  Was this answer useful?  Yes

rahul

  • Sep 22nd, 2014
 

Hi, One possible solution to the problem would be using incremental load and using a Join with Db component. with conditions to match records (use not equal to ) and filter rejected records.

  Was this answer useful?  Yes

sourabh

  • Feb 12th, 2015
 

There is new component "Dynamic compare record" for this purpose only, but in 3.1 version

  Was this answer useful?  Yes

pramod

  • May 5th, 2015
 

Using "sdiff" command will give the record by record comparison.
example: sdiff file1.txt file2.txt|grep "|"
this will give you the mismatched records

  Was this answer useful?  Yes

Mahesh

  • May 26th, 2021
 

1 Use all fields as key in in component with inner join and collect records from their respective ports
2 concat all the fields and use use field as key in in component with inner join and collect records from their respective ports
3 you can do same with lkp file

  Was this answer useful?  Yes

Anand Kishore

  • Oct 7th, 2022
 

Keep a file as lookup.
Use the syntax as lookup_match to get matching file and the rejected records are non matching record

  Was this answer useful?  Yes

Ahmad Ali Quraishi

  • Jan 6th, 2024
 

1.Use one file as lookup file and another as input file.
2. Use Filter by expression component and we can use !lookup_match("Lookup1",cust_id") in FBE

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions