|Date: ||Tue, 18 Dec 2007 22:48:59 +0000|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Ian Whitlock <iw1junk@COMCAST.NET>|
|Subject: ||Re: selecting a unique set of data.|
It isn't enough, that is why I labeled it a difficult problem.
You have to choose
in order to win this one, but you cannot know that until
after you have made the choices for A002 and A003. If you
do it in a DATA step, I think you need all the records
in an array and enough book keeping to back track when you
have made a bad choice, and then to use that bad choice if
it happens to be a bad choice.
In other words, to do it in a DATA step, you need a programmer
like Paul Dorfman.
On the other hand, there was a panel of programmers at the last
SGF that wrote programs to solve SUDOKU puzzles and this seems
to require the same sort of logic.
Date: Tue, 18 Dec 2007 14:23:58 -0500
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion"
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: selecting a unique set of data.
Comments: To: Ian Whitlock <iw1junk@COMCAST.NET>
I thought about sorting the data by the number of unique y in each x,
so that, the least number of y group get to pick the y first.
This could be done easily by SQL:
select *,count(distinct y) as ny
from have group by x order
by ny,x,y ;
But then I wasn't sure this is enough, so I didn't post.