data student1;
input name$ age score;
datalines;
wangwu 29 68
lisi 30 85
wangxi 28 79
lixingxun 32 91
wufang 27 56
;
run;
data student;
set student1;
run;
data student2;
input name$ age score;
datalines;
wangwu 29 88
lisi 30 89
wangxi 28 85
lixingxun 32 93
wufang 27 76
;
run;
/*显示原数据集*/
proc print data=student;
title "原数据集";
run;
/*remove移除观测*/
data student1;
modify student1;
if score <80 then remove;
run;
proc print data=student1;
title "remove";
run;
/*replace替换观测*/
data student;
modify student student2;
by name;
if score >85 then replace;
run;
proc print data=student;
title "replace";
run;
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
时间: 2024-10-13 13:34:03