I want to compare two strings which contains symbols from different alphabets (e.g. Russian and English). I want that symbols which looks similarly is considered as equal to each other.
E.g. in the word "Mom" letter "o" is from English alphabet (code 043E in Unicode), and in the world "Mоm" letter "о" is from Russian alphabet (code 006F in Unicode). So ("Mom" = "Mоm")
=> false, but I want it would be true. Is there some standard SAS function or I should wright a macro to do it.
Thanks!
I would do like that:
First I would make map. I mean which letter in Russian language corresponds to what letter in English language. Example:
б = b
в = v
...
I would store this map in a separate table or as macroVars. Then I would create a macro loop, with tranwrd function, which loops throug the map, which was created.
Example here could be like that.
data _null_;
stringBefore = "без";
stringAfter = tranwrd(stringBefore,"а","a");
stringAfter = tranwrd(stringAfter,"б","b");
stringAfter = tranwrd(stringAfter,"в","v");
...
run;
After this transformation I think You can compare your strings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With