LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 13 Nov 2000 14:01:12 -0800
Reply-To:     "Terjeson, Mark" <TERJEMW@DSHS.WA.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Terjeson, Mark" <TERJEMW@DSHS.WA.GOV>
Subject:      Re: Data Manipulation Question
Comments: To: Jie Qin <c674010@YAHOO.COM>
Content-Type: text/plain; charset="iso-8859-1"

PROC TRANSPOSE works pretty good,

data test1; input id1 id2 fact $; cards; 1 11 A 2 12 C 2 13 A 2 14 C 3 15 B 3 16 C 4 17 D ; run;

proc sort data=test1 out=test2; by id1; run;

proc transpose data=test2 out=test3(drop=_name_) prefix=fact; by id1; var fact; run;

Hope this is helpful, Mark Terjeson Washington State Department of Social and Health Services Division of Research and Data Analysis (RDA) (253) 840-2800 (253) 840-3566 fax (360) 902-0741 (360) 902-0705 fax

-----Original Message----- From: Jie Qin [mailto:c674010@YAHOO.COM] Sent: Monday, November 13, 2000 12:21 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Data Manipulation Question

I know there is a sample code somewhere, but I couldn't find it. Here is my dataset(id2 is unique in the dataset):

id1 id2 fact 1 11 A 2 12 C 2 13 A 2 14 C 3 15 B 3 16 C 4 17 D ........

I want the dataset change to like this: id1 fact1 fact2 fact3.... 1 A 2 C A C 3 B C 4 D .............

Does somebody know how to do that?

__________________________________________________ Do You Yahoo!? Yahoo! Calendar - Get organized for the holidays!

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