Hello, I have one dataset with responses from a patient questionnaire. The questions are all standard and the responses are multiple choice. I have another dataset that has the questions, all possible responses, and separate columns for a goal and plan of action for each corresponding response. Ex: Dataset 1 Column A - Question 1. What medical condition do you have Column B - Response Asthma Dataset 2 Column A - Question 1. What medical condition do you have Column B - Response Asthma Column C - Goal Ensure Asthma Medications are current Column D - Plan of Care Review medications with physician I'm trying to find a way to join the data using the criteria that if the question and answer match on both datasets, it will pull column A and B from Dataset 1 and Column C and D from Dataset 2 I've tried to following code: PROC SQL;
CREATE TABLE WORK.'MEMBER DATA'n AS
SELECT t1.ClientID,
t1.Question,
t1.Answer,
t1.AssessmentCreateDate,
t2.Need,
t2.'Problem
t2.'Care Goal
t2.'Activity/Intervention
FROM WORK.'MEMBER DATA'n t1
LEFT JOIN WORK.'MAPPING'n t2 ON (t1.Question = t2.'Question from Questionnaire (Item'n) AND (t1.Answer =
t2.'Trigger Response(s) from Questionnaire'n);
QUIT; There are multiple questions that have the same response options, but different questions so both the question and answer criteria have to match to pull the correct corresponding columns in table 2 (Ex: Do you smoke? Yes/No, Do you drink alcohol? Yes/No). What am I doing wrong? So sorry if I didn't submit this correctly...I'm very new to SAS and this forum. I'm on SAS EG 7.1 Thank you.
... View more