I am trying to match two different data sets via the variable name. The problem that occurs is that some of the names in data set 1 end with a letter "s", e.g. SMEDSTORPS or TOSTERUPS while in data set 2 the S at the end is missing.
Data set 1:
Data set 2:
When I use the following
not only the S at the end is removed but also all other S in the name.
Does someone have an idea how to fix this problem?
Thanks in advance!
Data set 1:
Code:
name SMEDSTORPS STIBY TOSTERUPS
Code:
name SMEDSTORP STIBY TOSTERUP
Code:
replace name = cond(substr(name,-1,.)=="S",subinstr(name,"S","",.),name)
Code:
name MEDTORP STIBY TOTERUP
Thanks in advance!
Comment