Date: Thu, 30 Mar 2006 17:26:58 -0500
Reply-To: Rushi Patel <rushi.b.patel@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Rushi Patel <rushi.b.patel@GMAIL.COM>
Subject: horizontal data into vertical
Content-Type: text/plain; charset=ISO-8859-1
SAS-L,
I an interested in transforming the following horizontal data into vertical..
id a1992 b1992 a1993 b1993
a1994 b1994
1 10 VR 10 VR
20 RV
2 20 VR 25 RV
30 XX
....
into
id year a b
1 1992 10 VR
1 1993 10 VR
1 1994 20 RV
2 1992 20 VR
2 1993 25 RV
2 1994 30 XX
I tried
PROC TRANSPOSE data = dat1 out = out1;
by id;
var a1992 - a1994 b1992 - b1994;
run;
but this would give both a and b under one column.
Thanks,
Rushi
|