|
|
Re: 请教:如何删除SAS数据集的空记录?
试试看这个...
[code:f6lsngbu]%macro dltblk(inds=,outds=);
proc contents data=&inds out=out(keep=name type) noprint;
run;
data _null_;
set out end=eof;
call symput ('var'||strip(put(_n_,8.)),name);
call symput ('type'||strip(put(_n_,8.)),type);
if eof then do;
call symput ('i',_n_);
run;
%put _user_;
data &outds(drop=count);
set &inds; count=0;
%do j=1 %to &i;
if &&type&j=1 then do;
if &&var&j=. then count+1;
end;
if &&type&j=2 then do;
if &&var&j="" then count+1;
end;
%end;
if count=&i then delete;
run;
%mend dltblk;
[/code:f6lsngbu] |
|