For something so simple you can also just use a DATA _NULL_ step and not bother with macro language. %let type=color; %let varlist=; data _null_; if "&type" = 'color' then call symput('varlist','red blue'); if "&type" = 'pattern' then call symput('varlist','solid stripe'); run; data data1 (keep= &varlist); set datalib.data1; run;
... View more