Thank you, Patrick! I am dealing with loads of them, since the data is coming from different countries. Here's an example: RESULT = תשובה לדוגמה.
My code currently uses substr to go character by character in every text string and identifies the position of a special character (if it finds one). This is working perfectly except for the instances like my example above where the entire string is special characters. In these cases SAS throws an error. Here is my code - it may be too out of context but maybe you can follow it? I'm just wondering why it won't do a substr if the whole value is special characters.
/* step through each character in the field to look for special character(s) */ do i = 1 to length(current_variable) ; if rank(substr(current_variable),i,1)) gt 0 and rank(substr(current_variable),i,1)) lt 32 or rank(substr(current_variable),i,1)) gt 127 then do; position= i; char = byte(rank(substr(varvalue,i,1))); nonascii_pos = catx(',',nonascii_pos,strip(put(position,8.))); nonascii = catx(',',nonascii,strip(char )); end; end;
Thanks for taking the time to answer my question!
... View more