Help using Base SAS procedures

Transposing Numbers

Reply
Occasional Contributor
Posts: 11

Transposing Numbers

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Transposing Numbers

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
Occasional Contributor
Posts: 11

Re: Transposing Numbers

Thanks Scott

It worked a treat.
Ask a Question
Discussion stats
  • 2 replies
  • 122 views
  • 0 likes
  • 2 in conversation