Hello experts,
I would like to change the text into number format in several variables. However, I found out the text format coming so many different ways. For example, the positive answer is 'Yes', 'Y','y', 'YES', 'yes'. My current coding couldn't cover all of the requirement. Any idea how to fix it? Thanks.
data want (drop = A B C D E);
set have;
array Old (*) A B C D E;
array New (*) AA BB CC DD EE;
do i = 1 to dim(Old);
if Old(i) in ('No', 'n') then New(i)=0;
else if Old(i) in ('Yes', 'y') then New(i)=1;
else if Old(i) in ('Unknown') then New(i)=9;
end;
run;
... View more