Proc MEANS is the procedure that springs to mind. The question however, is whether you want to find the means for D1 and D2 separately, or whether you also want to combine the two files together BEFORE you use PROC MEANS.
To simply concatenate the 2 datasets, a SET statement would be the most useful:
set d1 d2;
proc means data=all_d;