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 (December 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 2 Dec 2008 14:54:54 -0600
Reply-To:   Joe Matise <snoopy369@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Joe Matise <snoopy369@GMAIL.COM>
Subject:   Re: How to transpose the data in my way?
Comments:   To: Akshaya Nathilvar <akshaya.nathilvar@gmail.com>
In-Reply-To:   <67f588aa0812021227g36eeb301g73f1dd4bbbe7aa0@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

Does do over actually allow you to do that (iterate through two arrays at once)? If so, that's pretty interesting and useful to know :)

If not, you would just use: do i = 1 to 3; ... end;

(or 1 to whatever your upper limit of variable is).

-Joe

On Tue, Dec 2, 2008 at 2:27 PM, Akshaya Nathilvar < akshaya.nathilvar@gmail.com> wrote:

> One possible solution: > Data have; > input ID $ A1 A2 A3 B1 B2 B3; > cards; > QQ 1 2 3 5 2 4 > GG 3 8 3 6 7 4 > WW 4 5 6 6 1 8 > ; > > Data want; > set have; > array abc a1-a3; > array xyz b1-b3; > do over abc; > A=abc; > B=xyz; > output; > end; > keep ID A B; > Run; > > > Akshaya > > On Tue, Dec 2, 2008 at 2:55 PM, Ruby <windofoct@gmail.com> wrote: > > > Hello folks, > > > > Does anybody know how to transpose the data? I extracted my data in a > > simple way as showed below. As always, I appreciate all your helps > > very much. > > > > ID A1 A2 A3 B1 B2 B3 > > QQ 1 2 3 5 2 4 > > GG 3 8 3 6 7 4 > > WW 4 5 6 6 1 8 > > > > ID A B > > QQ 1 5 > > QQ 2 2 > > QQ 3 4 > > GG 3 6 > > GG 8 7 > > GG 3 4 > > WW 4 6 > > WW 5 1 > > WW 6 8 > > >


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