凑热闹,就是不知道变量多的时候函数的效率如何.
[code:15shshhg]data temp(drop=i);
set sashelp.class end=last;
output;
if last then do;
call missing(of _all_);
do i=1 to 10;
output;
end;
end;
run;
data temp2;
set temp;
if n(of _numeric_)=0 and cats(of _character_)=' ' then delete;
run;[/code:15shshhg]
楼主是我同事,这问题引来这么多高手回答。
首先这种情况很少发生,一般数据中都有关键词,只需要判断关键词是否为非空就可以。
DATA A;
INPUT A B C$;
CARDS;
1 3 5
. . C
3 . .
. . .
;
RUN;
DATA M;
SET A;
_DID=OPEN("A");
_DNVAR=ATTRN(_DID,"NVARS");
DROP _:;
IF CMISS(OF _ALL_) NE _DNVAR;
RUN;