03-04-2017 05:10 PM
I am trying to write a macro to concatenate all values of a row. But its not working. can some one point out? Without the macro its working fine.
create table values as select distinct(&var.) as vals from td;
length new_val $100.;
set values end=eof;
proc print data=values1;
03-04-2017 07:56 PM
Yes, macro language doesn't understand DATA step variables such as eof.
You seem to understand the right tools, why not use them:
select strip(var) into : vals separated by ',';
Or possible (but different):
select distinct strip(var) into : vals separated by ',';
If you really want this as a DATA step variable (although it is difficult to envision why), you could use:
longvar = "&vals";