data ds;
array x[10] ( 1, 2, 3, 4, 5, 6, 7, 8, 9,10);
do i = 1 to dim(x);
if mod(x[i], 2) = 0 then do;
even_number = x[i];
output;
end;
end;
drop i;
proc print noobs;
run;
i want output like below
x1 |
x2 |
x3 |
x4 |
x5 |
x6 |
x7 |
x8 |
x9 |
x10 |
even_numbers |
0 |
2 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
2 |
0 |
0 |
0 |
4 |
0 |
0 |
0 |
0 |
0 |
0 |
4 |
0 |
0 |
0 |
0 |
0 |
6 |
0 |
0 |
0 |
0 |
6 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
8 |
0 |
0 |
8 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
10 |
10 |