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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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