You have to make some business decisions before making programming decisions?
I'm going to use ID instead of Permno to avoid autocorrect in the rest of my answer.
Why are there duplicate ID's?
Is there a duplicate record in terms of time or just name?
Are the company with the same name actually the same business entity?
If you want to delete a record and they're not identical other than ID's how do you decide which record(s) to delete?
For removing duplicates look into PROC SORT.
If you need help with the programming please post sample data with expected output.