09-16-2017 11:54 AM
09-16-2017 03:05 PM
Note that I've moved and renamed your thread to better reflect the topic and find an answer.
The easiest way is either PROC FREQ or PROC SQL.
Assuming the diagnosis code and diagnosis description align, ie one diagnosis only matches one diagnosis description and they are the same over time.
Here's one way:
proc freq data=have noprint; table EmpID*DiagnosisCode*DiagnosisDescription / out=distinct_diagnosis_per_emp; run;
09-16-2017 09:46 PM
May be without EmpID unless you want the distinct list per EmpID. Else: As long as you can be sure that a code has always the exactly same description things should work.
09-16-2017 10:33 PM
You can, but that will give you a list in the output, not a data set. The PROC FREQ generates a data set.
To modify the PROC SQL you could add a CREATE TABLE statement.
09-16-2017 11:38 PM
How does this work?
This will create a "Unique" table with data.
create table Unique as
select distinct EmpID, DiagnosisCode, DiagnosisDescription from Diag_tbl;