BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
swimmer23
Calcite | Level 5

Hello, 

 

I have the following dataset (here is an excerpt from it): 

product_categorypart1part2part3part4
hose_connectorconnector1connector2connector3connector4
printerprinter1printer2printer3printer4
glassesglasses1glasses2glasses3glasses4

 

I want to convert the dataset shown above into the following one:

hose_connectorconnector1
hose_connectorconnector2
hose_connectorconnector3
hose_connectorconnector4
printerprinter1
printerprinter2
printerprinter3
printerprinter4
glassesglasses1
glassesglasses2
glassesglasses3
glassesglasses4

 

Can anyone tell me what SAS command I can use to create this transpose of the data?

 

Thank you in advance for your support. 

1 ACCEPTED SOLUTION

Accepted Solutions
1 REPLY 1
Reeza
Super User
Have you tried PROC TRANSPOSE?

https://stats.oarc.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/

proc transpose data=have out=want;
by product_category;
run;

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 516 views
  • 0 likes
  • 2 in conversation