Desktop productivity for business analysts and programmers

transpose row data into multi columns

Posts: 0

transpose row data into multi columns

Below are the contents of my dataset with 4 observations and 4 columns(a,b,c,d) with values x, y, z, x in each observation.
a b c d
1 x x x x
2 y y y y
3 z z z z
4 x x x x

Now, I need to transform this into below structure:

a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 a4 b4 c4 d4
== == == == == == == == == == == == == == == ==
x x x x y y y y z z z z x x x x

In the other sense, all the row data needs to be transformed into columns (appending each column name with the observation a1, b1, a2, b2 etc...)

How I can achieve this, any easy way to accomplish this?
Super Contributor
Super Contributor
Posts: 3,174

Re: transpose row data into multi columns

For future consideration, it is not necessary to post a question in more than one forum.

Posts: 0

Re: transpose row data into multi columns

Are you using SAS DI or you want to do this using PROC ?
If you are doing SAS DI then use Process Library -> Data Transforms -> Transpose,

If you check the Contents Help you have Step-by-Step Procedure for how to Do this , It is simple & easy to follow so i am not going to re invent the wheel here!

Good Luck
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation