|
5#

楼主 |
发表于 2011-4-8 03:55:16
|
只看该作者
Re: 求助,压缩数据
compress= option only works with SAS dataset, not the desired TXT output
here is my experiment, hope that it helps to sxlion. Check the file size of ex1.txt and ex.txt (9.57MB vs. 19.1MB), 50% missing.
but my question here is that if you completely omit blank space for missing values, how could u recover those missing data in the right positions?
[code:ue6dtzw7]
data ex;
array var{1000};
do id=1 to 1e4;
do j=1 to dim(var);
if ranuni(0)<0.5 then var[j]=floor(ranuni(0)*10);
else var[j]=.;
end;
keep var:;
output;
end;
run;
data _null_;
file "c:\ex.txt" dlm='09'x;
set ex;
put var1-var4;
run;
data _null_;
file "c:\ex1.txt" dlm=' ';
set ex;
array var{1000};
do j=1 to dim(var);;
if var[j]^=. then put var[j] @@;
end;
run;
[/code:ue6dtzw7] |
|