BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 346 views
  • 1 like
  • 3 in conversation