BookmarkSubscribeRSS Feed
aaou
Obsidian | Level 7

Hi,

I have a timeseries dataset. In it, I have a variable that contains company names. But the company names change in many observations across time. I want to match and replace the company names so that companies  which are (obviously) the same have the same name in the dataset and not several different names.

 

Ex: XYZ,XYZ Company, XYZ & CO, XYZ CO etc. all will have one name such as for example 'XYZ Company'.

1 REPLY 1
RickAster
Obsidian | Level 7

The name matching problem is addressed in chapter 81 of Professional SAS Programming Shortcuts with example code at http://www.globalstatements.com/shortcuts/81b.html. The example is based on the idea of matching two separate data sets but most of the same ideas would apply when the data is in a single data set. 

 

In a smaller version of the problem where there are only a few hundred values, you may just want to create a table that maps each distinct character value to the canonical form of the name that you would want to see.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1049 views
  • 0 likes
  • 2 in conversation