The following query can be used to list common variables (regardless of case) among multiple data sets:

proc sql;
select distinct upcase(name)
from dictionary.columns
where libname='WORK' and memname in ('D1','D2','D3','D4','D5','D6')
group by upcase(name)
having count(*)>1;
quit;

This can be used to find common variable(s) that will be overwritten when data sets are merged. Bost (2007) uses PROC SQL to rename common variables to prevent overwriting when merging two data sets. Young (2011) adapts this technique with a macro to prevent overwriting when merging more than two data sets.