Even shorter which takes advantage only wanting the first two characters. The format applied will have the output show just the first two characters. No need for additional variables or data set.
proc freq data=import;
tables record_id*(sex ethnicity age);
format record_id $2. ;
run;
... View more