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 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 17 Dec 2002 11:05:37 +0800
Reply-To:     =?gb2312?q?Johnson=20Chang?= <jchangmail@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         =?gb2312?q?Johnson=20Chang?= <jchangmail@YAHOO.COM>
Subject:      Re: Sorting by a formatted value
Comments: To:
In-Reply-To:  <>
Content-Type: text/plain; charset=gb2312

Like this,

proc sql; create table table2 select * from table1 order by put(Skin_Colour, $skinord.);

HTH, J Chang

--- Michael Friendly <friendly@YORKU.CA> 的正文:> I'm creating tables with character variables I need to arrange > in a particular non-alphabetic order. > > I can do this in several steps, > > proc format; > value $skinord 'White'='1' 'Brown'='2' 'Black'='4' 'Other'='3'; > > data table1; > set table1; > skinorder = put(Skin_Colour, $skinord.); > run; > proc sort data=table1; > by skinorder ; > > > But I'm wondering if there is a simpler way, perhaps with > PROC SQL. > > -michael > -- > Michael Friendly > York University > Psychology Department > 4700 Keele Street Tel: (416) 736-5115 x66249 > Toronto, Ontario, M3J 1P3 Fax: (416) 736-5814

_________________________________________________________ Do You Yahoo!? "您想享受2-7折星级酒店价格吗?"

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