farever_lover 发表于 2011-4-13 15:18
一个数据集中有变量a b c,如果a不等于缺失,那么剔除变量b c,保留a;如果a等于缺失,那么剔除变量a,保留b c,如何实现呢?
data a;
set b;
if a=. then drop a;else drop b c;
run;
这样好像实现不了。请教高手。
data a;
set b;
if col1^=. then do; drop col2 col3 col4;end;
if col1=. then do; drop col1;end;
if col5^=. then do;drop col6 col7 col8;end;
if col5=. then do;drop col5;end;
................
run;
大概共10个if语句