Hi guys,
How to split name as single letters
data ds;
input name $15.;
datalines;
aabbbs
bbssaaf
;
run;
Output:
Name | letter_1 | letter_2 | letter_3 | letter_4 | letter_5 | letter_6 | letter_7 |
aabbbs | a | a | b | b | b | s | |
bbssaaf | b | b | s | s | a | a | f |
Since this is a very simple task for someone who has worked with SAS for several years now, what have you tried so far?
A similar question was already asked here few times e.g.,
or
https://communities.sas.com/t5/SAS-Programming/split-name-as-single-letter/m-p/878153
Try to improve your googling skills 😉
Bart
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.