I am working with a survey from survey monkey and unfortunately the data was imported with the column values in words and complete sentences. So for each question the answers to the question come in separate columns for Instance: q1. Have taken care of someone dying before? a. yes b. No c. Maybe yes, No and Maybe all come out as variables with columns of their own instead of just being values under a single variable called question 1. So, I have been trying to combine the separate answers into a single column all under q1 by using 'if then ' statements but I have an issue when it comes to questions with answers that are a whole lengthy sentence. I try to combine them under a new variable and it seems to run but but I end up with an empty column. My log file doesn't claim any major errors but just puts an exclamation mark next to the if then statements. i'll appreciate any help I can get with this. I have attached the code, and a picture of the dataset table when I open it in table view in SAS and also my log file. data two; set two;
if strongInf='Are a strong influence on my attitude toward death and dying' then ReligBlf='Strong Religious Influence';
if minorInf='Are a minor influence on my attitude toward death and dying' then ReligBlf='Minor Religious Influence';
if noInf='Do not influence my attitude toward death and dying' then ReligBlf='No Religious Influence';
run; So in this instance the survey question was about whether religious beliefs influenced respondents attitude towards dying patients. The response options are the three variables above, which come in 3 separate columns. Instead of just one as answers under the variable religious beliefs. So I tried to recombine them into one under a new variable 'ReligBlf'. So I try to create a new variable with the 3 columns combined but always end up with an empty new column. "Relig Blfs" This is my log file I'll appreciate any help. Thanks.
... View more