[程式] SAS 指令,如何留下重複值

看板Statistics作者 (姿穎)時間4年前 (2020/04/15 16:12), 編輯推噓4(407)
留言11則, 4人參與, 4年前最新討論串1/1
[軟體程式類別]:SAS [程式問題]:資料處理 [軟體熟悉度]: 新手 [問題敘述]: 跑資料庫時想留下同一個案name變項的所有資料 ,只單做一次的個案刪除 不知道程式碼應該如何下手填寫 [程式範例]: 無 如果有熟悉軟體之強者幫助會十分感激 ----- Sent from JPTT on my Google Pixel 4 XL. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.128.139.121 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1586938356.A.C3F.html

04/16 02:01, 4年前 , 1F
proc sql;
04/16 02:01, 1F

04/16 02:01, 4年前 , 2F
create table MoreThanOne as
04/16 02:01, 2F

04/16 02:01, 4年前 , 3F
select *
04/16 02:01, 3F

04/16 02:01, 4年前 , 4F
from OldData
04/16 02:01, 4F

04/16 02:01, 4年前 , 5F
where name not in
04/16 02:01, 5F

04/16 02:01, 4年前 , 6F
(select name from Oldata group by name having count(*
04/16 02:01, 6F

04/16 02:01, 4年前 , 7F
)=1);
04/16 02:01, 7F

04/16 02:01, 4年前 , 8F
quit;
04/16 02:01, 8F

04/16 18:52, 4年前 , 9F
先sort,然後篩not(first.id =1 & last.id =1)
04/16 18:52, 9F

04/19 12:45, 4年前 , 10F
proc sort nouniquekey
04/19 12:45, 10F

04/23 12:19, 4年前 , 11F
m大是對的,我記得要再加上 by id
04/23 12:19, 11F
文章代碼(AID): #1Ubi7qm_ (Statistics)