How to change missing value from some default value in SAS dataset?
Solution:-
data nn ;
input a b ;
datalines;
1 .
. 3
5 .
;
proc print ; run ;
first run this code and check the dataset value!
Here is the solution of the problem........!
data nnn;
set nn ;
array m[*] _numeric_;
do i=1 to 2 ;
if m(i) =. then m(i)=0;
end ;
proc print ; run;
Solution:-
data nn ;
input a b ;
datalines;
1 .
. 3
5 .
;
proc print ; run ;
first run this code and check the dataset value!
Here is the solution of the problem........!
data nnn;
set nn ;
array m[*] _numeric_;
do i=1 to 2 ;
if m(i) =. then m(i)=0;
end ;
proc print ; run;
Arrays are tricky for a fresher..
ReplyDeleteA simple options missing = ; statement would do