LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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

Back to: Top of message | Previous page | Main SAS-L page