I have a dataset consiting of 40 rows (ResInd_1 - ResInd_40) each with a combination of one or more of the numbers 1-19.
Example
ssid ResInd_1 ResInd_2 ResInd_3 ResInd_4 ...
1 1 1,4 4,8,10,11 2,19
2 2,3 1,5 2,6 1
...
I'd like to count the number of times each number occurs in total
obs occuring
1 4
2 3
3 1
Your best bet is to restructure your data using PROC TRANSPOSE and SCAN() it so that you only have one value per cell.
Then PROC FREQ will do the counts.
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
Submit your proposal →
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.
Browse our catalog!