Data editing > Data correction > Missing values in numeric fields > Missing values in arithmetic expressions and assignments
 
Missing values in arithmetic expressions and assignments
The general rules for non-numeric data variables in arithmetic assignments are as follows:
Blanks in an otherwise numeric field are ignored, but totally blank fields are read as zero.
&’s in an otherwise numeric field are ignored, but fields full of &’s are read as zero.
A – in an otherwise numeric field makes the number negative.
Multicodes in an otherwise numeric field are ignored, but a field in which all columns are multicoded is read as zero.
If you switch on missing values processing these rules are modified so that any field that is not totally numeric or a combination of numbers and blanks is counted as missing.
Missing values are represented by the special value missing_.
Here is a table showing samples of data in a numeric field and the difference missing values processing makes to the way that data is interpreted:
Data in numeric field
missingincs 0
missingincs 1
123
123
123
1 3
13
13
–10
–10
–10
ABC
zero
missing_
1AB
1
missing_
000
zero
zero
&&&
zero
missing_
1&1
11
missing_
three blanks
zero
missing_
If you print variables whose values are missing_ in a report file or write them out to a data file, Quantum will show their values as -1,048,576 rather than as the word missing_.
If an arithmetic expression uses a variable whose value is missing, the value of the expression differs depending on whether or not missing values processing is switched on. If missing values processing is switched on the value of the expression is always missing_. If it is switched off, the value of the expression is always zero. For example, if c(1,3) contains the string ABC:
missingincs 1
t1 = c(1,3) * 100
sets t1 to missing_, but:
missingincs 0
t1 = c(1,3) * 100
sets t1 to zero.
See also
Missing values in numeric fields