Date: Tue, 7 Mar 2006 11:31:07 -0500
Reply-To: SUBSCRIBE SAS-L Anonymous <sas_use@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: SUBSCRIBE SAS-L Anonymous <sas_use@YAHOO.COM>
Subject: Transposing data
Hello All,
I am running into a problem. If anyone can help me, i would really
appreciate it.
My dataset looks somewhat like this.
ID SEX BP PULSES
1 F 110 76
1 F 110 76
1 F 110 76
1 F 110
1 F 110
2 M 110 80
2 M 110
2 M 110 80
2 M 146
When I do PROC TRANSPOSE
proc transpose data = one out = two(drop=_LABEL_);
var bp pulses;
by subjid sex;
run;
then I get an output something like this
ID SEX _NAME_ COL1 COL2 COL3 COL4 COL5
1 F BP 110 110 110 110 110
1 F PULSES 76 76 76
2 M BP 110 110 110 146
2 M PULSES 80 80
But my problem is that I want the output to look like,
ID SEX NAME Value
1 F BP 110
1 F BP 110
1 F BP 110
1 F BP 110
1 F BP 110
1 F PULSES 76
1 F PULSES 76
1 F PULSES 76
2 M BP 110
2 M BP 110
2 M BP 110
2 M BP 146
2 M PULSES 80
2 M PULSES
2 M PULSES 80
2 M PULSES
Thanks for helping in advance !
Misha