|
Hi,Yiannakoulias
You may use proc sql.
proc sql noprint;
create table result as
select *
from t
group by id
having max(valuen)=valuen;
quit;
Regards,William
"N Yiannakoulias" <nwy@srv.ualberta.ca> wrote in message
news:aghjt9$9q4$1@pulp.srv.ualberta.ca...
> Hi all,
>
> I have a large data set which represents a 2 dimensional
> grid over a geographic area. I've built an adjacency
> file of this grid that looks like this:
>
> ID NID ValueN
> 1 2 65
> 1 6 26
> 2 1 26
> 2 3 30
> 2 7 2
> 3 2 65
> 3 4 34
> 3 8 88
> and so on...
>
> ID is an identifier for each grid
> NID is a neighbour's ID
> ValueN is a value associated with a neighbour
>
> Now, I want to group adjacent records such that starting
> with area 1 (represented by ID=1) the adjacent area with
> the largest ValueN is grouped with this area (ID=1).
> Once a neighbour is grouped, it can no longer be a part
> of any other group. _This is where I get stuck_. For
> example, NID=2 meets the condition for area 1. As a
> result, records with NID=2 AND ID=2 should be removed
> from the dataset as I proceed with grouping. I haven't
> been able to do this successfully. Can anyone offer
> any advice? It seems pretty trivial, but maybe it isn't?
>
> N
>
|