Replace missing values in SAS

后端 未结 2 1710
执念已碎
执念已碎 2020-12-19 08:46

How do you replace all missing values with zeroes in SAS? I have a text file that I dump into SAS to process some geo data, but whenever it has a missing value it breaks the

相关标签:
2条回答
  • 2020-12-19 09:25

    Another option:

    proc stdize data=mydata reponly missing=0 out=newdata;
    var _numeric_;
    run;
    

    If you have SAS/STAT, probably faster than the datastep option for large datasets.

    0 讨论(0)
  • 2020-12-19 09:40

    You can set all the missing values to 0 with like this:

    data myData;
    set myData;
    array a(*) _numeric_;
    do i=1 to dim(a);
    if a(i) = . then a(i) = 0;
    end;
    drop i;
    

    This will convert any numeric "." to a 0

    0 讨论(0)
提交回复
热议问题