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
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*.