Syntax rules (COMPUTE command)

  • The target variable must be named first, and the equals sign is required. Only one target variable is allowed per COMPUTE command.
  • If the target variable is numeric, the expression must yield a numeric value; if the target variable is a string, the expression must yield a string value.
  • Each function must specify at least one argument enclosed in parentheses. If a function has two or more arguments, the arguments must be separated by commas. For a complete discussion of functions and their arguments, see Transformation Expressions.
  • You can use the TO keyword to refer to a set of variables where the argument is a list of variables.