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 (April 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Apr 2003 13:01:52 -0500
Reply-To:     Nathaniel_Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nathaniel Wooding <Nathaniel_Wooding@DOM.COM>
Subject:      Re: how to transfrom SAS data structure
Comments: To: Samuel Yu Du <du_samuel@HOTMAIL.COM>
Content-type: text/plain; charset=us-ascii

Samual

Proc Transpose does this nicely. You do need a data step that will create a variable that will become part of the new variables' names.

Nat Wooding

data a; informat system $5. ; input system number; cards; IBM 23 IBM 56 NT 12 NT 34 data a; set; by system;* i am assuming that this is sorted by system; if first.system then count=0; count+1; proc print; proc transpose out=a prefix=variable; var number; id count; by system; proc print;run;

Samuel Yu Du <du_samuel@HOTMAI To: SAS-L@LISTSERV.UGA.EDU L.COM> cc: Sent by: "SAS(r) Subject: how to transfrom SAS data structure Discussion" <SAS-L@LISTSERV.U GA.EDU>

04/02/03 12:51 PM Please respond to Samuel Yu Du

hi, SAS users:

Originally, I have a data set of the following format:

variable

-------------------------

IBM 23

IBM 56

NT 12

NT 34

-------------------------

The question is how I can use SAS to transform this format into:

variable1 variable 2

--------------------------------

IBM 23 56

NT 12 34

--------------------------------

Thanks,

MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.


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