LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 28 Sep 2005 14:37:25 -0700
Reply-To:   Toby <tobydunn@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Toby <tobydunn@HOTMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: How to create columns from obersation values
Comments:   To: sas-l@uga.edu
In-Reply-To:   <433b0b2e$0$17210$8fcfb975@news.wanadoo.fr>
Content-Type:   text/plain; charset="iso-8859-1"

John Doe,

Not too sure why you want yoru data this way but hey to each their own.

data one ; infile cards ; input week $ name $ A $ B $ Value ; cards ; 01 shoes a1 b1 120 02 shoes a2 b2 80 ; run ;

proc transpose data = one out = two (drop = _name_) prefix = Week_ ; by week ; var Value ; id week ; copy name A B ; run ;

proc print data = two ; run ;

Toby Dunn

Hello,

i would like to break down some values in columns. Let's look the picture:

What i have: --------------------------------- | week | name | a | b | value | --------------------------------- | 02 | shooes | a1| b1| 120 $ | | 01 | ... | a2| b2| 80 $ |

What i want: ---------------------------------------- | name | a | b | week_01 | week_02 | ... ----------------------------------------- | shooes | a1| b1| . | 120 $ | ... | ... | a2| b2| 80 $ | . | ...

* i don't know how many week there is (this will change with time, because in the real data, the year is included) * off course, the week values are not unique

I've tried - transpose : without success - array : you need to know the name of the new column in advance

Any help really appreciated


Back to: Top of message | Previous page | Main SAS-L page