I wonder whether it's possible to concatenate each record within one observation with SAS code. E.g.
Here is the original data set
1st_name 2nd_name 3rd_name .....last_name
abc def ghi ..... xyz
Now I want to add a variable that concatenates all values from 1st_name to last_name--separated by a specific separator, if possible.
Expected result
1st_name 2nd_name 3rd_name .....last_name all_name
abc def ghi ..... xyz abcdefg...xyz
Of course there is one way
data name;
set name;
length all_name $ 30;
all_name=1st_name||2nd_name....||last_name;
run;
However, things will get terrible if there are hundreds of variables. So the question has been how to do it automatically, without having to specify variable names, numbers etc.
Looking forward to answers from SAS experts:)