I have two variables for employment status: one for parent 1 and another for parent 2. There are 3 values for both of them. 1-employed 2-unemployed and L-logical skip if parent is not alive. I would like to create a new variable out of both variables using the logical step value. This is my code: data version2017; set version2017; if Parent1=1 AND parent2=1 then employment=1; *Both parents employed; else if (parent1=1 AND parent2 IN (2,.)) OR (parent1 IN (2, .) AND parent2=1) then employment=2; *at least one parent employed; else if parent1=2 AND parent2=2 then employment=3; *no adult employed; else employment =.; run; Unfortunately, my code doesn’t work. I am unable to treat L as a character because my variable is numeric. How can I factor L into my code?
... View more