BookmarkSubscribeRSS Feed
uksusu
Calcite | Level 5
I have a large dataset similar in set up to that below:

account date value
1 month1 10
1 month2 25
1 month3 19
2 month1 8
2 month2 0
2 month3 18
3 month1 23
3 month2 9
3 month3 27

What I want to do is to collapse the account to 1 row per account and create a new dataset to look like this:
account month1 month2 month3
1 10 25 19
2 8 0 18
3 23 9 27

Do I need to use an array for this, or would transpose work in some way?

Thanks for any help. Message was edited by: uksusu
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Check PROC TRANSPOSE in the SAS DOC, the forum archives, or search the SAS support website for technical / conference reference material on the topic.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

proc transpose site:sas.com
uksusu
Calcite | Level 5
Thanks Scott

It worked a treat.

SAS Innovate 2025: 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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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