Here is one way that the data step which generates the macro variables can immediately re-create them with macro quoting.
data _null_;
if eof then call symputx('stop',_n_-1);
set topcust1 end=eof;
mvar=cats('custname',_n_);
call symputx(mvar,custname);
call execute(catx(' ','%let',mvar,'=%superq(',mvar,');'));
run;
Although in your situation why not just add real quotes?
data _null_;
if eof then call symputx('stop',_n_-1);
set topcust1 end=eof;
call symputx(cats('custname',_n_),quote(trim(custname),"'"));
run;
...
(where=(custname=&&custname&i))
...
... View more