Date: Mon, 22 Jun 2009 16:21:08 +0200
Reply-To: karma <dorjetarap@GOOGLEMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: karma <dorjetarap@GOOGLEMAIL.COM>
Subject: Re: please help me do in a simple way instead of using several
data steps
In-Reply-To: <801147c6-03b5-474a-b12d-b9e1aea4b889@y9g2000yqg.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Proc transpose will do this for you
data have ;
input subj pulse temp height weight ;
cards ;
101 64 36 174 68
102 67 36.4 182 72
;;;
proc transpose data=have out=needed(rename=(col1=newval))
name=newvar ;
by subj ;
var pulse-numeric-weight ;
run ;
proc print ;run ;
2009/6/22 kasa <venkatrkasa@gmail.com>:
> Currently i am using several data steps in order to derive needed data
> set.
> can you please help me to do it efficiently.
>
> data have
> subj pulse temp height weight
> 101 64 36 174 68
> 102 67 36.4 182 72
>
> data needed
> subj newvar newval
> 101 pulse 64
> 101 temp 36
> 101 height 174
> 101 weight 68
> 102 pulse 67
> 102 temp 36.4
> 102 height 182
> 102 weight 72
>