Below code should work but is untested because you didn't provide sample data in a usable format.
proc sort
data=&input_dataset(keep=tel_number full_name)
out=intermediate
nodupkey;
by tel_number full_name;
run;
data &output_dataset;
set intermediate;
by tel_number;
if first.tel_number then name_count=1;
else name_count+1;
if last.tel_number and name_count>1 then
do;
&message=catx(' ','Telephone : ',tel_number,'Suspicious.... to', name_count,'people...');
....
output;
end;
run;
For future questions please post your data and code as text and not as screenshots. Use icons
![Patrick_0-1648583285463.png Patrick_0-1648583285463.png](https://communities.sas.com/t5/image/serverpage/image-id/69932iAD8CFBEF03182449/image-dimensions/124x47?v=v2)
to do so.
Would you have been happy if I'd posted my reply as picture?
![Patrick_1-1648583331312.png Patrick_1-1648583331312.png](https://communities.sas.com/t5/image/serverpage/image-id/69933i6D0DB59B25269817/image-dimensions/548x248?v=v2)