I would need to extract the first three consonants for each element of a list. Can someone help me?
thank you very much
LIST TO BE
PAROLA PRL
LIBRO LBR
NEWSPAPER NWS
Use compress-function to remove vowels, then substr to get the first three chars.
consonants = substr(compress(word, 'aeiou', 'i'), 1, 3);
if you are 100% sure that you have only upcase letters in your list, than use
consonants = substr(compress(word, 'AEIOU'), 1, 3);
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.