0
votes

I have a datafile having same column names. I want to merge them without any seperator and get it in new column. But I am getting subsequent columns as var2 var3 var4 etc. How can we merge them in sas?

As I have columns of different variables with same name, for eg: my column order is name1, name2, name2,name1,name2 , we cant use var1,var2 for merging. What can we do?

My csv datafile is similar to this enter image description here

And my corresponding sasdata is enter image description here

How can we get a merged column?(column name can be "EMPLOYMENT")

1
@Bendy how to do this?Abdul Shiyas

1 Answers

1
votes

Not completely sure I understand the question, but I think you want to use cats(). e.g. newvar=cats(var1,var2,var3). This concatenates the values with no separators and no leading or trailing spaces.

coalesce() is another option that will take only the first nonmissing value in the list.