Date: Tue, 8 Feb 2005 13:59:49 -0500
Reply-To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject: Re: Proc Transpose
Alice Loeffler wrote:
> This is probably mickey mouse to most of you. But I am trying to
> transpose a file that looks something like this:
>
> 01400 ANESTHESIA SERVICE op
> 01922 ANESTHESIA SERVICE op
> 01953 ANESTHESIA SERVICE op
> 01999 ANESTHESIA SERVICE op
>
> Into something like this:
> ANESTHESIA SERVICE 01400 01922 01953 01999
>
> A simple Proc transpose is not working for me
>
> proc transpose data=PEDSa
> out= PEDSb;
> run;
You need to indicate by groups and variable to transpose.
If "01400" is variable LINE and "ANESTHESIA SERVICE" is PROCEDURE, then the
code would be
> proc transpose data=PEDSa
> out= PEDSb;
by PROCEDURE;
var LINE;
> run;
Also, it looks like the data is sorted by PROCEDURE LINE. This is good.
Try this neat thing. In enhanced editor window, put cursor in word
'transpose'. Press F1 to get context sensitive help.
--
Richard A. DeVenezia
http://www.devenezia.com/