uihiba
04-07-2009, 12:22 PM
I have a data set with 2 columns that I need to compare for similarities. In the first column, I have a set of codes separated by commas and in the second column, I have another set of codes separated by commas.
So for example, in the first column, say, I have the following: 100, 101, 102 (all 3 in one cell) and in the second column I have 105, 101, 107, 109, 110 (all in one cell).
What I need for SAS to do is compare the two cells and tell me which number repeats so for the above example, it would be 101.
I tried proc compare but it keeps truncating the entries in each cell.
The entries are defined as characters if that makes a difference.
FYI: I'm not an expert programmer so I would appreciate a detailed/clear response. Thanks! :)
*Please don't suggest another software/language to tackle this. I HAVE to do this in SAS.*
So for example, in the first column, say, I have the following: 100, 101, 102 (all 3 in one cell) and in the second column I have 105, 101, 107, 109, 110 (all in one cell).
What I need for SAS to do is compare the two cells and tell me which number repeats so for the above example, it would be 101.
I tried proc compare but it keeps truncating the entries in each cell.
The entries are defined as characters if that makes a difference.
FYI: I'm not an expert programmer so I would appreciate a detailed/clear response. Thanks! :)
*Please don't suggest another software/language to tackle this. I HAVE to do this in SAS.*