Replace missing values in SAS

后端 未结 2 1711
执念已碎
执念已碎 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: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

提交回复
热议问题