Hi,
I have a dataset containing the variable "memname". The values of "memname" may contain one or more Danish characters like Æ, Ø and Å. I need to convert these to AE, OE and AA respectively. The new converted values are stored in the variable "memname_dk". Examples of values with Danish characters include "ÅRSOPGØRELSE" and "ANSØGT_VILKÅR".
I have tried to use different loops to make sure that all Danish characters are converted but didn't succeed yet so in the end I decided to simply run three almost identical data steps (see below). However, I am sure there must be a more simple way to do this. Can anybody help me please?
Here's the current solution:
data aa;
set aa;
memname_dk=memname;
if find(memname_dk,'Æ') > 0 then memname_dk=tranwrd(memname,'Æ','AE');
run;
data aa;
set aa
if find(memname_dk,'Ø') > 0 then memname_dk=tranwrd(memname,'Ø','OE');
run;
data aa;
set aa
if find(memname_dk,'Å') > 0 then memname_dk=tranwrd(memname,'Å','AA');
run;
Thanks,
Helle
... View more