BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
How to transpose and ascending display of brand name?

proc sort data= cmopdod_v2_qunty;
by outlet _Brand_Name;
run;
proc transpose data=cmopdod_v2_qunty out=wide2(drop=_name_);
id Brand_Name;
by outlet;
var quantity;

run;
1 REPLY 1
ArtC
Rhodochrosite | Level 12
Just to clarify, what about the result data set is not what you want? The variable names in the new data set will be placed on the PDV in ascending order. Using sashelp.shoes I tried your code:
[pre]proc sort data= sashelp.shoes out=shoes;
by subsidiary product;
run;
proc transpose data=shoes out=wide2(drop=_name_);
id product;
by subsidiary;
var sales;
run; [/pre]

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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