The term is TRANSPOSE
Transposing data tutorials:
Long to Wide:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/
Wide to Long:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/
@Feyng819 wrote:
My original data look like this:
var1 var2 var3
1 3 C
And I want to make them look like this (splitting one row of data into four rows, var2 goes under var1, the value of var1 shows one row of data with var3 and one row of data without var3)
var1 var2 var3
1 . .
1 . C
3 . .
3 . C
Thank you!!
The term is TRANSPOSE
Transposing data tutorials:
Long to Wide:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/
Wide to Long:
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/
https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/
@Feyng819 wrote:
My original data look like this:
var1 var2 var3
1 3 C
And I want to make them look like this (splitting one row of data into four rows, var2 goes under var1, the value of var1 shows one row of data with var3 and one row of data without var3)
var1 var2 var3
1 . .
1 . C
3 . .
3 . C
Thank you!!
@Feyng819 wrote:
Im not sure if I am using the transpose correctly
Show your code if you're not sure if your code is correct.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.