Reputation: 1439
Lets say for example I have a variable in SPSS named var1 containing ones and zeros. And I have another variable var2 which I want to set to sysmis if var1 = 1.
How can I do that in SPSS?
The line
IF (var1=1) var2 = SYSMIS.
produces an error.
Upvotes: 1
Views: 1780
Reputation: 1439
The trick here is to use the system variable $SYSMIS
.
IF (var1=1) var2 = $SYSMIS.
$SYSMIS is documented in Variables section under Universals section in the Syntax Reference Guide.
Upvotes: 1