Hi all, I have 21 variables of results (rslt_1 - rslt_21). Values within each variable are 'yes', 'no', 'unknown' and blanks. I am interested in one variable, lets call it helpme, that will tell me whether or not a subject ever had a 'yes' in any of the 21 results. If not, then I want the value of helpme to be either no or none if results were no, unknown, or blank. For example, I would like my final data to look like this: rslt_1 rslt_2 rslt_3 ... rslt_21 helpme yes no unknown yes no no no yes yes yes none I use an array, right? But I'm getting stuck on creating the new variable. Here's the code I have tried, which creates "helpme" but without any values and SAS tries to convert my character variables to numeric. data want (drop=i); set have; array rsltarray (21) rslt_1-rslt_21; do i=1 to 21; if rsltarray(i) in ('yes') then helpme='yes'; else if rsltarray(i) in ('no', 'unknown') then helpme='no'; else if rsltarray(i) in ('') then helpme='none'; end; run; Thanks so much!
... View more