Hi experts,
I'm using tranwrd in sas enterprice guide and works fine, but when i use it in the linux environment it does not work
data ALTAS_DEF;
set ALTAS_DEF;
First_name = tranwrd(First_name, 'ñ', 'n');
run;
i just want to change a letter for other one, do you know a work around about it ? or an equivalent function ?
If you only need to change a character ,NOT a word/string, try KTRANSLATE().
data s;
set sashelp.class;
First_name = ktranslate(name, 'n','ñ');
run;
I'm using tranwrd in sas enterprice guide and works fine, but when i use it in the linux environment it does not work
This makes no sense. The SAS language is the very same on all platforms. I suspect you have another issue, like encoding.
Run this to verify:
%put &=sysencoding;
It is usually not a good idea to insert non 7-bit ASCII character constants into your program. Then the meaning of the code will change depending on the character encoding that is being used.
The Spanish character "enye" will be stored as different sets of bytes depending on the encoding you are using. And for some single byte encodings it might not even exist.
To check what encoding SAS is using for your SAS session check the value of the ENCODING system option.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.