For example: col1-col10, dsn1-dsn 7 , or data1 to data10 with common variable of ID.
Considering we have 10 datsets and all of them having the same prefix data;
%macro mymerge (n);
merge %do i = 1 % to &n;
data&i %end; ; /* this additional ';' is necessary, the first ';' is for the "%end", while the second ';' is for "Merge"*/;