BookmarkSubscribeRSS Feed

[SAS 활용 FAQ] 데이터의 key에 대한 obs가 중복되는 관측치 나타난다면 중복값 중 1개만 남기고 삭제하려 할 때는 어떻게 해야 하나요?

Started ‎05-18-2021 by
Modified ‎05-30-2021 by
Views 398

SAS의 sort 프로시져 이용시에 nodupkey 옵션 혹은 데이터 스텝 first.을 사용하면 됩니다.

 

예 1) sort 이용시

proc sort data=old out=new nodupkey;

by X Y; /* 중복되는 변수명 */

run;

 

예 2) first.이용시

data b;

set a;

by x;

if first.x=1;

run;

Version history
Last update:
‎05-30-2021 10:02 PM
Updated by:
Contributors

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Article Labels
Article Tags