Hi @all.
After switching from local to server, we had to change some functions in our programming.
The reason behind this is the utf-8 compatibility. The version we use is SAS 9.4.
One function we had to change is compress to kcompress.
Which is quite painful since kcompress doesn't support modifier.
I've got a program that tries to fix telephone numbers.
data work.DQ;
Phone='+49O64343565ABC'; output;
run;
data work.DQ; set work.DQ;
DQ_Phone=compress(Phone,"0123456789+",'k');
run;
Do you have any idea how to extract a certain list of characters from one string and insert it into another without using compress and modifier?
Thanks a lot for any help!
Roman
You don't have to use kcompress, you only use it when the string might contain double or more byte characters - and if you phone numbers contain those I would be worried. Anyways, work around it by something like:
compress(kcompress(phone,""),"01234567890+")
Unfortunately there is a good chance a phone number could contain ä,ü,ö
But those are single byte characters so shouldn't cause an issue for compress?
If you can provide some example - test data in the form of a datastep - which illustrates your issue I can look, but this:
data have; a="abcdäefg1234"; b=compress(a,"","kd"); run;
Works fine for me.
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.