Data?
That stuff on the left is does not make sense.
And your desired(?) output doesn't make sense either as it clearly shows that Col2 =Cat1and Col3=Dog1 are associated with multiple values of Col5. Cat1 is associated with pig1, pig2 and pig3. Dog1 is associated with pig1, pig2, pig3 and pig4. So the result does not make sense.
What is the LOGIC, as in rules, involved here?
And please provide a starting data set in the form of working data step code.
From what you show I suspect you have already manipulated data and possibly made it harder to accomplish the desired goal.
... View more