Hi All, I think this code is better for me: %let brand= bmw; &brand; proc sql; select distinct NAME into :KEEP_LIST separated by " " from DICTIONARY.COLUMNS where LIBNAME="WORK" and MEMNAME="HAVE" and (index(upcase(NAME),upcase("&BRAND."))>0); quit; %put &keep_list; data want; set have (keep= name--sex &KEEP_LIST.); run; Question: As I have already mentioned that I am creating prompts for the user to choose the brands. I am not entirely sure if this line of code works when user selects more than one brand? and (upcase(NAME) in ("NAME","AGE","SEX") or index(upcase(NAME),upcase("&BRAND1."))>0 or index(upcase(NAME),upcase("&BRAND2."))>0); Is there anyway we can use 'in' for the &brand? (ex: (index(upcase(NAME),in upcase("&BRAND."))>0); Thank you all for your helpful suggestions.
... View more