thank you for your response, the code works except that have1 has 3000 observations, have2 has 100000 observations. I want to have the final output to have 3000 observations, some items matched with have2 some unmatched. using this code, i have an output with around 100000 observations.