02-18-2016 05:52 PM
I want by using sql (or by other methode) to create a macro variable like this
I have tried sql with
select distinct name into :v_name sparated by '',''
I will get name= Bob','alice','Petter, but I want to get name= 'Bob','alice','Petter'
02-19-2016 04:46 AM
What exactly are you going to do with a macro variable which resolves as:
I assume your going to use it in either a do loop or an SQL where. Might I suggest a better way of doing it for SQL would be to put your parameters in a dataset and use a where (subclause) sytax, e.g:
data params; param="Bob"; output; param="Alice"; output; param="Petter"; output; run; proc sql; select * from HAVE where NAME in (select PARAM from PARAMS); quit;