Is there a way through PROC FREQ to gather the frequencies of just the first letter of names? For example, I have a list of 50 names under the variable Name. I would like to take the frequencies of names by the first letter of the name. I have done this creating a new variable which takes a substring of the original name variable, and it works fine. But I am wondering if there is a way within PROC FREQ where I can do this without having to create a new variable? This is the code I have used:
DATA FirstNames;
INFILE "(insert file)" firstobs=2;
INPUT Name $ @@;
Letter=substr(Name,1,1);
RUN;
proc freq data = FirstNames;
Tables Letter;
run;