SQL is good.
data have;
input field_name :$9. rock_type :$9. size;
datalines;
cantarell carbonate 100
cantarell carbonate 100
cantarell clastic 100
lakach clastic 13
lakach clastic 13
lakach carbonate 13
;
run;
proc sql;
select distinct field_name,rock_type,size
from
(
select *,count(*) as n
from have
group by field_name,rock_type
)
group by field_name
having n=max(n)
;
quit;
... View more