InterviewSolution
Saved Bookmarks
| 1. |
Explain different ways to remove duplicate values in SAS. |
|
Answer» Below are two ways to delete duplicate values in SAS:
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;
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; |
|