Question & Answer
Question
I do have a variable X in my file with some system missing values. I do want to create a new variable Y which is 1 when a case in X is value 0 and Y should be 2 for cases that are non equal zero in X. For system missing values I would like to have the value 99 in the new variable Y and would like to define it as user missing value. I tried it with the syntax below. However, when I look at the result the values of Y are all fine but not for the system missing values. They are still SYSMIS and not 99, why is this? DATA LIST / x (F2.0). BEGIN DATA 0 0 2 1 1 5 END DATA. EXECUTE. DO IF (X EQ 0). COMPUTE Y=1. ELSE IF (X NE 0). COMPUTE Y=2. ELSE IF SYSMIS(X). COMPUTE Y = 99. END IF. MISSING VALUES Y (99). EXECUTE.
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21512391