|
Although you could do this with an array or simply a set of output
statements, I agree with Karma that Proc Transpose is a simple way to go.
Here are two additional ways to code the proc. The primary differences are
in the way the Var statement is written.
data have;
input subj pulse temp height weight;
cards;
101 64 36 174 68
102 67 36.4 182 72
proc print;
run;
Proc Transpose data = have out = wanted ( rename = ( col1= newval _name_ =
newvar ));
var pulse temp height weight;
by subj;
run;
proc print;
run;
* alternative ;
Proc Transpose data = have
out = wanted ( rename = ( col1= newval _name_ = newvar ) where = (
newvar ne 'subj'));
var _numeric_ ;
by subj;
run;
Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Cel Phone: 804-205-0752
kasa
<venkatrkasa@GMAI
L.COM> To
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
Discussion" cc
<SAS-L@LISTSERV.U
GA.EDU> Subject
please help me do in a simple way
instead of using several data
06/22/2009 10:17 steps
AM
Please respond to
kasa
<venkatrkasa@GMAI
L.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
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.
|