/*and if you wanna avoid the sort and make sql manage with distinct, have that as inline view as demonstrated below*/
proc sql;
create table want as
select *, count(email) as counter
from (select distinct Access_Number,Email from have)
group by email
order by Access_Number;
quit;
... View more