[Skip Global Navigation]

SPSS Tech Tips

SPSS Direct Home

Working with system-missing values in SPSS for Windows™ 15.0

This is a complimentary tip available to SPSS Direct subscribers.

Question

I’m using SPSS for Windows 15.0 and have missing values in my data file. I am writing syntax to manipulate my data and need to reference the missing values. Looking at the SPSS Command Syntax Reference Guide, I see references to SYSMIS, $SYSMIS, and
SYSMIS() at various places. How do I determine which to use?

Answer

In all three of these examples, SYSMIS, $SYSMIS, and SYSMIS() are related to system-missing values. Each of them should be used in a specific context, and using the wrong reference typically causes errors in the output.

SYSMIS is an input and output keyword. In the SPSS Command Syntax Reference Guide, SYSMIS is documented in the commands that use this keyword, such as RECODE. Use SYSMIS when you want to recode some value(s) as system missing, or to recode a system-missing value into some other value. In the example below, system-missing values would be recoded to “99.” In addition, any cases with a “10” for variable v1 would be recoded to system missing.

RECODE v1 (SYSMIS = 99) (10 = SYSMIS).
EXECUTE.

$SYSMIS is a system variable for a system-missing value. In the SPSS Syntax Reference Guide, it is documented in the Universals section under “variables.” Use $SYSMIS when you want to set the values of a numeric variable to system missing. For example, if you have a variable (v1) that has three cases (1,2, and 3), the following commands

IF (v1 < 2) v1 = $SYSMIS.
EXE.

would transform the data to:


V1
.
2
3

Finally, SYSMIS() is a function. In the SPSS Syntax Reference Guide, you can find documentation about SYSMIS() in the Universals section under “transformation expressions.” Use SYSMIS() when you want to specify the condition that a variable has a system-missing value. It returns “true” or “1” if the value is system missing, and “false” or “0” otherwise.

Example:
IF SYSMIS(v1) v2 = 1.
EXE.

What if the condition is that a variable doesn't have system-missing values? The syntax is:

IF NOT(SYSMIS(v1)) v2 = 2.
EXE.