BookmarkSubscribeRSS Feed
THelmig
Calcite | Level 5

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

Example

obs  occuring

1       4

2       3

3       1

...

 

1 REPLY 1
Reeza
Super User

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. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1265 views
  • 0 likes
  • 2 in conversation