|
7#

楼主 |
发表于 2011-9-13 09:23:45
|
只看该作者
Re: 【新手求助】SAS数据集查缺失
[quote="byes":33kzenil][code:33kzenil]
data _null_;
length msg $100;
dsid=open('a');
nobs=attrn(dsid,'nobs');
nvar=attrn(dsid,'nvars');
do i=1 to nobs;
rc=fetchobs(dsid,i);
do j=1 to nvar;
if vartype(dsid,j)='N' then do;
if missing(getvarn(dsid,j)) then do;msg='第'||i||'行,变量'||varname(dsid,j)||'缺失';put msg;end;
end;
else if vartype(dsid,j)='C' then do;
if missing(getvarc(dsid,j)) then do;msg='第'||i||'行,变量'||varname(dsid,j)||'缺失';put msg;end;
end;
end;
end;
rc=close(dsid);
run;
[/code:33kzenil][/quote:33kzenil]
~>_<~+ 谢谢~ 你们太强大了 我表示压力很大 |
|