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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 676 views
  • 0 likes
  • 2 in conversation