In SAS, suppose I have a dataset named "person_groups". It has two variables, named "person" and "group". This dataset simply assigns each person to a group.
How can I remove from this dataset all persons who have no one else in their group? In other words, how can I remove all singleton groups?
[I'd be happy with a proc sql
solution or a data step
solution--either is fine.]
Side note: I'm new to SAS. I have been using C++ and MATLAB for many years. I feel like I can't understand how to do anything with the SAS DATA step. It seems extremely clunky, bizarre, and inelegant. Frankly, I'm growing very frustrated. Anyone out there have hope for the weary? :)