Date: Wed, 10 Oct 2007 23:01:22 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: Export Repeated Measure Table to Excel reformatted
transpose the data first then use proc export:
proc transpose data=xx out=flat;
by x;
var y;
id z;
run;
proc export data=flat ...
...
On Wed, 10 Oct 2007 19:53:47 -0500, OR Stats <stats112@GMAIL.COM> wrote:
>Hello:
>
>I have a SAS table that looks like the following:
>
>X Z Y
>x1 1 y11
> 2 y12
> 3 y13
>.
>.
>.
>x1 n y1n
>x2 1 y21
>.
>.
>xm n ymn
>
>I would like to export this SAS dataset to Excel transposed in such a way
>that I have only m rows (for my m distinct x's); n columns (for my n groups
>within Z class); and the y's are elements of this new m x n matrix.
>Ideally, the n columns in the resulting Excel sprdsht would have the n
>distinct headings, or titled by the n group values/names. And the row
>header for each of the m rows in Excel would be the m distinct values that
X
>takes on. So the values in the SAS table that are truly unique are the
>Y's. Does anyone have any idea how to export this automatically without
>using the GUI-based export?
>
>Cheers,
>ORstats
>
>E.g., SAS
>X Z Y
>A 1 y11
>A 2 y12
>A 3 y13
>B 1 y21
>B 2 y22
>B 3 y23
>C 1 y31
>C 2 y32
>C 3 y33
>
>exported to EXCEL would be
>
> 1 2 3
>A y11 y12 y13
>B y21 y22 y23
>C y31 y32 y33
|