I have a dataset with thousands of datalines that I need counted. Here's an example of what I'm trying to do:
dataset exampe1:
eric | a |
eric | b |
eric | a |
eric | b |
eric | a |
sara | b |
sara | c |
sara | b |
I would like to take dataset example1 and create this output:
# of times a | # of times b | # of times c | |
eric | 3 | 2 | 0 |
sara | 0 | 2 | 1 |
Thank you!
Thanks so much! You're awesome!
proc tabulate data=have;
class name grade;
table name, grade*n='';
run;
If you want a report and do not need a dataset.
Thank you
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.