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 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 18 Dec 2007 03:03:40 +0000
Reply-To:   iw1junk@COMCAST.NET
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ian Whitlock <iw1junk@COMCAST.NET>
Subject:   Re: selecting a unique set of data.
Comments:   cc: souga soga <souga1234@GMAIL.COM>

Summary: Specs should precede solution. #iw-value=1

Souga,

In your example every value of X has every value of Y. If this is accurate then sort by X Y, and select first record in first group of X's, second record from the second group, etc. to the last group of X's taking the last record in the group.

If your example is not accurate, then it makes no sense for anyone to give an answer until more is known about the requirements. For example, suppose there are 5 distinct value of X and 4 distinct values of Y, then it is impossible to have every value of X in the output file no matter how the Y values are distributed. Consequently there is no solution when all values of X must be used.

So the real question is - what do you have, and what are the requirements for what you want? Knowing why would also help us to know whether the problem is worth thinking about.

It sounds like some kind of operations research problem.

Ian Whitlock ============== Date: Mon, 17 Dec 2007 19:36:40 -0500 Reply-To: souga soga <souga1234@GMAIL.COM> Sender: "SAS(r) Discussion" From: souga soga <souga1234@GMAIL.COM> Subject: selecting a unique set of data. Content-Type: text/plain; charset=ISO-8859-1

Hi,

X="A001";Y=10;OUTPUT; X="A001";Y=20;OUTPUT; X="A002";Y=10;OUTPUT; X="A002";Y=20;OUTPUT;

I need the output to be:

X="A001";Y=10;OUTPUT; X="A002";Y=20;OUTPUT;

ie. the value of y should not repeat for x

Thanks, Sa


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