Maybe a macro program looping to create new datasets named 1 to 27, keeping id and variables named like the index, like the one below could help?
%macro createsubdata();
%DO j = 1 %TO 27;
data have&j;
set have;
keep id M&j:;
run;
%END;
%mend;
%createsubdata();