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
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.