RECODE inputVector test inputNumber resultVariable

Replaces the contents of the result variable with the elements of the input vector except that any element of the input vector that satisfies the test is replaced by the input number.

COPY 1,10 A
RECODE A between 5 8 1 B
PRINT A B

The above program produces the following output:

A: (1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0)
B: (1.0 2.0 3.0 4.0 1.0 1.0 1.0 1.0 9.0 10.0)