Hello, it has been a while since I've used SAS (using University Edition) and I'm not sure how to go about a problem I'm having. I have a cohort of patients, and each patient has had data recorded at 5 visits. At each visit, it's recorded if a referral was needed (1) or not (0). So each patient might have data that looks like this: ref1= 1 ref2=0 ref3=0 ref4=0 ref5=1 I need to create a new variable (referral) that is populated with 'yes' or 'no' if any one of the ref#=1; so if the patient ever needed a referral, during any visit, the new variable will reflect that. Right now I am using the following code, but something isn't working. I feel like I need to use an array or DO loops, but like I say, it's been a while. Thank you for your help! DATA want; SET have; IF (ref1-ref5) = . THEN referred = ' '; ELSE IF (ref1-ref5) = 1 THEN referred = ' Yes'; ELSE IF (ref1-ref5) = 0 THEN referred = ' No'; RUN;
... View more