Hi...I'm teaching myself SAS and am new to this community board. I am trying to recode 12 categorical variables (pbc_1-pbc_12) with the response "yes", "no", and "unsure". In my code, "yes" = 2, "no" = 1, and "unsure" = 3. I want to only capture the "yes" responses from the 12 variables and create one variable (precon). I'm using "else if" statements, but the code is not working. I also don't know if I am accounting for the "no" and "unsure" responses correctly. I essentially want to examine the distribution of "yes" responses. precon=.; if pbc_1 = 2 then precon = 1; else if pbc_2= 2 then precon = 2; else if pbc_3= 2 then precon = 3; else if pbc_4 = 2 then precon = 4; else if pbc_5= 2 then precon = 5; else if pbc_6 = 2 then precon = 6; else if pbc_7 = 2 then precon = 7; else if pbc_8 = 2 then precon = 8; else if pbc_9 = 2 then precon = 9; else if pbc_10 = 2 then precon = 10; else if pbc_11 = 2 then precon = 11; else if pbc_12= 2 then precon = 12; else precon = .; Please help any way you can. Also, if there is a more sophisticated way of doing this type of procedure please let me know. Thanks! Trace
... View more