SPSS If
The IF command conditionally assigns a value to a variable.
Contents
Usage
if (foo=1) bar = 1. if (ltrim(rtrim(foo))="") bar = ''.
The parentheses are optional.
When comparing string variables, string literals, and string expressions within a condition, trailing space characters are not truncated. Consider wrapping all variables and expressions with the RTRIM function.
If a string literal or string expression differs in length compared to the target variable, it is truncated or padded with space characters as needed.
Data Model
The IF command is queued as a pending transformation.