[程式] sas程式碼id的刪除
[軟體程式類別]:
sas
[程式問題]:
資料處理
[軟體熟悉度]:
中(3個月到1年)
[問題敘述]:
id stroke_id
1 1
1 0
2 0
2 0
3 0
3 1
4 0
4 0
想請問大家
有哪一個sas的指令可以告訴它
如果stroke_id曾經有1的
就要刪除掉這個id的所有紀錄
也就是新檔案我只需要keep id 2和4的資料就好了
我目前只想到一個土方法
if stroke_id=1 then output;
給予一個新變項(stroke=1)告知說這id有stroke
merge回原始的檔案
如果stroke =1 then delete;
我想請問有比較簡單的code可以直接進行刪除掉id=1, 3的資料嗎?
因為這個方法太繞圈圈了
老闆好像不喜歡
謝謝
-----------------------------------------------------------------------------
--
http://www.wretch.cc/album/maryastro
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.1.187
推
08/06 18:34, , 1F
08/06 18:34, 1F
推
08/07 00:05, , 2F
08/07 00:05, 2F
→
08/07 00:08, , 3F
08/07 00:08, 3F
討論串 (同標題文章)