I have variables x1 to x10 in a data set. And I want to stack them into two columns: (col 1): x1, x3, x5, x7, and x9 and (Col 2): x2, x4, x6, x8, and x10

Can't seem to figure this one out.

- Thread starter sandeep249
- Start date
- Tags sas

I have variables x1 to x10 in a data set. And I want to stack them into two columns: (col 1): x1, x3, x5, x7, and x9 and (Col 2): x2, x4, x6, x8, and x10

Can't seem to figure this one out.

Are you sure you are not going wide to long, see this example (would require you renaming your variables and perhaps adding an identifier) but could get you there.

http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm