Re: [問題] 如何切割重複資料
data test;
input id sex score;
cards;
1 1 60
2 1 78
3 2 77
1 1 70
1 1 66
3 2 59
;
run;
proc sort data=test out=test;
by id sex;
run;
data test1;
set test;
by id sex;
if first.id=1 and last.id=1 and first.sex=1 and last.sex=1 then output;
run;
data test2;
set test;
by id sex;
if not (first.id=1 and last.id=1 and first.sex=1 and last.sex=1) then output;
run;
※ 引述《leo20090401 (花花超人)》之銘言:
: 簡言之直接舉例
: input id sex score
: cards;
: 1 1 60
: 2 1 78
: 3 2 77
: 1 1 70
: 1 1 66
: 3 2 59
: ;run;
: 想切成兩塊1.有重複2無重複共兩個檔
: 有重複資料集
: 1 1 60
: 1 1 70
: 1 1 66
: 3 2 77
: 3 2 59
: 無重複資料集
: 2 1 78
: 感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.255.243.39
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):