BookmarkSubscribeRSS Feed
CathyVI
Lapis Lazuli | Level 10

Hi,

This may sound simple but I need help.

concatenate 2 dataset and the observations output seems fine.

Data 1 have 12316611 obs and187 columns

Data 2 have 12316611 obs and 86 columns

When I concatenate I got Total rows: 24633222 Total columns: 268 but I expected 273 column. Why is  the number of variables is reduced.  Could this be related to variables having different attributes. How do I resolve the issue. Thanks

 

 

2 REPLIES 2
Tom
Super User Tom
Super User

Why would you expect there to be more than 187 variables?  Are you saying that you expected NONE of the variables between the two datasets to be the same?  Then why did you concatenate the datasets?  They don't appear to have anything to do with each other.

 

As it is it appears that the second dataset have 268 - 187 = 81 variables that are NOT in the first dataset.

So there are only 5 variables that they have in common.

ballardw
Super User

Show the code that you used to "concatenate" the data sets.

 

It sounds like you did a data step merge and that you have 5 variables (not "columns") with the same name in both sets.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 928 views
  • 2 likes
  • 3 in conversation