That's what you get when you try to do data processing in the macro language. That many macro variables is often a sign of a not well designed issue.
And the macro language treats literal characters a bit differently than the data step and quotes are often inappropriate.
You are "compressing" the literal value DX1 for instance. So there is no "space" or "." to begin with.
Is DX&i a macro variable? or a data set variable?
You should show a bit more of what you are attempting for code. Since the macro language doesn't recognize "output" I strongly suspect you are mixing macro language and data step incorrectly.
If you want to go over a bunch of DATA SET variables named DX1, DX2 etc then you likely want something more like:
array vars DX1 - DX50;
do i= 1 to dim(vars);
if compress(vars[i],'.') in ('DS123') then output;
end;