In reply to R..

It sounds like you want to examine all pairwise data sets for common variables. This leads to "N choose 2" combinations to consider. Yes, that can be done. It would be straightforward in SAS/IML by using the ALLCOMB function. If you need more help or you want the solution by using SQL, post your question to the SAS Support Communities.