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 (March 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 28 Mar 2003 12:54:52 -0500
Reply-To:     Jay Weedon <jweedon@EARTHLINK.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jay Weedon <jweedon@EARTHLINK.NET>
Organization: http://extra.newsguy.com
Subject:      Re: reorder data set ?
Content-Type: text/plain; charset=us-ascii

On 28 Mar 03 17:00:10 GMT, Hamani.Elmaache@CCRA-ADRC.GC.CA (Elmaache, Hamani) wrote:

>Hi all. >I have data like this: > >Town Category Dollar Variance > >Ottawa A 100 21 >Ottawa B 150 30 >Tokyo A 120 18 >Tokyo B 110 19 >Seatle A 160 20 >Seatle B 111 14 > > >I want to have it like this: > >Town Dollar_A Dollar_B Variance_A Variance_B > >Ottawa 100 150 21 30 >Tokyo 120 110 18 19 >Seatle 160 111 20 14 > >Can someone help?

data new; set old; retain dollar_a variance_a; drop category dollar variance; select(category); when ('A') do; dollar_a=dollar; variance_a=variance; end; when ('B') do; dollar_b=dollar; variance_b=variance; output; end; end; run;

JW


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