Hello, I hope this message finds you well. I would like to request assistance, if possible, with counting the number of common elements in different columns in SAS. I'm working with a dataset with ~120 observations, but will be using a simpler example to try to troubleshoot. I'm using SAS 9.4. I was given this dataset with several values in one observation, separated by commas (data from a survey where respondents could select more than one response), as below: I was able to use an array and do-loop to separate out the values into different columns, as below: My question is, how can I count the number of common elements in these four different columns, to end up with something similar to this result in a table output in SAS: When I use proc freq / tables to tabulate the frequencies of my fav_color1, fav_color2, and fav_color3 variables in SAS, I end up with three different tables with the frequencies of the favorite colors for each column, but another way to ask my question is: how can I combine these three tables to get the one table, as above? Thank you so much for your assistance. Please let me know if I can clarify anything. Diana
... View more