I wrote code to modify values if the values in the two arrays satisfy a condition. However, in the process, all missing values that did not satisfy the conditions were converted to 0.
I want to know why this happened and have the code to fix it. Here is the code I wrote:
data data2;
set data1;
array array_a a1 a2 a3 a4 a5;
array array_b b1 b2 b3 b4 b5;
do i=1 to dim(array_a);
if array_a[i]=0 & array_b[i]=0 then array_a[i]=.;
end;
drop i;
run;