Monday, 28 January 2013

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;

1 comment:

  1. Arrays are tricky for a fresher..
    A simple options missing = ; statement would do

    ReplyDelete