BookmarkSubscribeRSS Feed
daniele_1306
Calcite | Level 5

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

1 REPLY 1
andreas_lds
Jade | Level 19

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);

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 1 reply
  • 961 views
  • 2 likes
  • 2 in conversation