BookmarkSubscribeRSS Feed
christinagting0
Quartz | Level 8

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?

 

 

 

4 REPLIES 4
PGStats
Opal | Level 21

Use aliases to make the column names distinct.

PG
christinagting0
Quartz | Level 8

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

PGStats
Opal | Level 21

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
LinusH
Tourmaline | Level 20
Can you please attach the SAS program/log...
Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1513 views
  • 1 like
  • 3 in conversation