Arithmetic operations (COMPUTE command)

COMPUTE V1=25-V2.
COMPUTE V3=(V2/V4)*100.
 
DO IF Tenure GT 5.
COMPUTE Raise=Salary*.12.
ELSE IF Tenure GT 1.
COMPUTE Raise=Salary*.1.
ELSE.
COMPUTE Raise=0.
END IF.
  • V1 is 25 minus V2 for all cases. V3 is V2 expressed as a percentage of V4.
  • Raise is 12% of Salary if Tenure is greater than 5. For remaining cases, Raise is 10% of Salary if Tenure is greater than 1. For all other cases, Raise is 0.