SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Duplicate Column Error when Merging?

Reply
Frequent Contributor
Posts: 88

Duplicate Column Error when Merging?

Hi everyone, 

 

I'm so close to finishing this! 

 

My very last step is giving me this error:

 

Duplicate column names have been detected in the above query which requested that
CORRESPONDING column names be matched. This situation is ambiguous.

 

How the heck do I fix this? do I have to delete all duplicate column names somehow?

 

Is there a way to find all the duplicate column names in SAS?

 

 

 

Respected Advisor
Posts: 4,640

Re: Duplicate Column Error when Merging?

Use aliases to make the column names distinct.

PG
Frequent Contributor
Posts: 88

Re: Duplicate Column Error when Merging?

Hi PG, 

 

Can you or someone else please elaborate on this answer?

 

Why do I need to make the column names distinct? By Column names are you rerferring to the Variable names (i.e., making the variable names distinct)?

 

So for example I have the following variabels from 2 separate datasets that I'm trying to merge into one:

 

Dataset 1

Variable A Variable B Variable C

 

Dataset 2

Variable A Variable B Variable C

 

I want to merge these two datasets and all 3 variables. So Variable A from dataset 1 and 2 are in one column in the final merged dataset. 

 

This is why I don't understand why I need to make the column names distinct b/c I don't want them to be distinct. Unless I am misunderstanding the solution?

 

Can someone please explain to me in basic terms and with basic examples? 

 

Thank you so much

When I am merging the 2 datasets I want all 3 variables to be merged together

Respected Advisor
Posts: 4,640

Re: Duplicate Column Error when Merging?

I don't fully understand how you got the message "Duplicate column names have been detected in the above query which requested that
CORRESPONDING column names be matched." since I didn't see the query in question. But I figure that if you get the names to be distinct, you will understand what's going on.

PG
Super User
Posts: 5,254

Re: Duplicate Column Error when Merging?

Can you please attach the SAS program/log...
Data never sleeps
Ask a Question
Discussion stats
  • 4 replies
  • 399 views
  • 1 like
  • 3 in conversation