1.

Explain different ways to remove duplicate values in SAS.

Answer»

Below are two ways to delete duplicate values in SAS: 

  • The use of nodups in the procedure:

The NODUPRECS (or NODUPREC or NODUP) option of PROC SORT identifies observations with identical values for all columns and REMOVES them from the output DATA set.

Proc sort data=SAS-Dataset nodups; By varname; run;
  • The use of PROC SQL in the procedure:

PROC SQL can be used to remove duplicates. The DISTINCT keyword is used in the SELECT CLAUSE to ACCOUNT for duplicate observations.

proc sql; create table New_dataset as select distinct * from Old_dataset where var=distinct(var); quit;


Discussion

No Comment Found