BookmarkSubscribeRSS Feed

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

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

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;

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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

Register now

Article Labels
Article Tags