Use an OUTPUT statement to control the output. I don't know what you're expecting the user_id statement in the IF statement to accomplish. It will evaluate to true if the user_id is greater than 0. Perhaps something like this: data act.three; set act.two; by user_id; if user_id and act_id in (28 29) then do; respondent_id=c_id; output; end; if user_id and act_id in (27) then do; respondent_id=m_id; output; end; if user_id and act_id in (25) then do; respondent_id=s_id; output; end; run;
... View more