Hi i have a data set which contains some value (lets say a,b,c e.t.c) , now i have to create a macro for those values and that macro i have to use in a sql like (where name in (¯o) so i am trying to concatenate the observations by single cotes and a comma but its not working for example i am trying the sashelp.class HAVE WANT F 'F', M 'M' also please note that in the last observation we don't need the comma to be there in the result proc sql; create table test1 as select distinct sex from sashelp.classfit order by sex; quit; data test2; set test1; by sex; if last.sex = 1 then sex1=cat("'",sex,"'"); else sex1 = cat("'",sex,"'",","); run;
... View more