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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.