Hello, I have a huge data with lab results (25 fields) and it is dirty. I will need to categorize the final (clean) results for my analysis but before that step I need to clean the unwanted characters such as "=","ug/dl", "<" or ">" comes along with the numerical result. I want to use array and do loops because I have 25 variables. I want to set anything below 5 to "1". Here is my code: data wanted; set have; array AResult(25) Result_1-Result_25; do i=1 to 25; if AResult(25) in ('<0.5','3.8ug/dl','4.0ug/dl','4.1ug/dl','4.2ug/dl','<.3.3','<5','LOW','LOW <3','=1.3') then AResult{25}=1; else AResult{25}=AResult{25}; END; RUN; I am getting this error:ERROR: All variables in array list must be the same type, i.e., all numeric or character. How can I handle this error? Example Data: data work.patients; infile datalines dlm=","; input pateint_id Result_1 Result_2 Result_3; datalines; 1, =70, 65, 82 2, 88, =75, 79ug/dl 3, 64, 72,=80; run; Thanks.
... View more