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

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 838 views
  • 0 likes
  • 2 in conversation