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 (August 2011, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 11 Aug 2011 03:06:26 -0400
Reply-To:   Søren Lassen <s.lassen@POST.TELE.DK>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Søren Lassen <s.lassen@POST.TELE.DK>
Subject:   Re: A ReOrdering issue ( need help)
Comments:   To: Tom Smith <need_sas_help@YAHOO.COM>
Content-Type:   text/plain; charset=ISO-8859-1

Tom, I do not quite get what you are trying to do. You have a table that repeats itself (row 1-10 are equal to row 11-20), with no other differences, and you want to sort the two repetitions in a specific order - why not just keep the first half?

To sort that, you can do something like this:

proc format; invalue sexnum 'Male'=-2 'Female'=-1 other=_same_ ; run;

data temp; set pp(obs=10); sort=input(number,sexnum.); run;

proc sort data=temp out=ww; by sort descending goal; run;

If you really want the repetition of the first 10 rows, you can just append HAVE to itself:

proc append data=ww base=ww; run;

Regards, Søren

On Wed, 10 Aug 2011 08:14:47 -0400, Tom Smith <need_sas_help@YAHOO.COM> wrote:

>I have a dataset pp with two variables (number, goal) as below: > > >number goal >------ ---- >Male SL >Female SL >17 SL >18 SL >24 SL >Male PL >Female PL >17 PL >18 PL >24 PL >Male SL >Female SL >17 SL >18 SL >24 SL >Male PL >Female PL >17 PL >18 PL >24 PL > >I need to reorder the values of the variables in following sequencc and >create dataset ww > > >number goal >------ ---- >Male SL >Male PL >Female SL >Female PL >17 SL >17 PL >18 SL >18 PL >24 SL >24 PL >Male SL >Male PL >Female SL >Female PL >17 SL >17 PL >18 SL >18 PL >24 SL >24 PL > >Thanks you so much


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