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 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 20 Dec 2006 11:09:05 -0800
Reply-To:     "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject:      Re: Transposing data
Comments: To: Chirag Taneja <ctaneja@INDUCTIS.COM>
Content-Type: text/plain; charset="us-ascii"

Hi,

Here is one approach:

data sample; input Acno FrNo1 Frno2 Frno3 Fred1 Fred2 Fred3; cards; 1 1 2 3 1 3 2 2 4 5 6 7 8 9 ; run;

proc transpose data=sample out=temp1(rename=(col1=Frno)); by Acno; var FrNo:; run;

proc transpose data=sample out=temp2(rename=(col1=Fred)); by Acno; var Fred:; run;

data result(drop=_name_); merge temp1 temp2; by Acno; run;

Hope this is helpful.

Mark Terjeson Senior Programmer Analyst, IM&R Russell Investment Group

Russell Global Leaders in Multi-Manager Investing

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Chirag Taneja Sent: Wednesday, December 20, 2006 10:56 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Transposing data

Hi,

Can you guys please help me out with a simple transposing problem .

I have a dataset like this:

Ac no FrNo1 Frno2 Frno3 Fred1 Fred2 Fred3

1 1 2 3 1 3 2

2 4 5 6 7 8 9

I want output like this

Ac no Frno Fredno

1 1 1

1 2 3

1 3 2

2 4 7

2 5 8

2 6 9

Thanks


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