Hi @PrinceAladdin,
If my understanding is right, here is an approach.
[1] Read into a string of all variables.
[2] Replace 'n/a' by '.'.
[3] Scan each variable so that '.' will also be read by SCAN function using 'S' option.
data have;
array a a1 - a5;
input ;
_infile_ = tranwrd(_infile_,'n/a', '.');
do i = 1 to dim(a);
a[i] = scan(_infile_,i,' ', 's');
end;
drop i;
datalines;
1 2 n/a 2 1
2 1 . 1 2
3 n/a n/a 2 1
;
run;
Edited:
To avoid the
NOTE: Character values have been converted to numeric values at the places given by
on the LOG, replace the statement
a[i] = scan(_infile_,i,' ', 's');
By
a[i] = input(scan(_infile_,i,' ', 's'),8.);
... View more