2
votes

I have run the following command in SPSS. But It's showing error

STRING NSAL(A8).
IF(EDU>12 AND GENDER='M') RECODE SAL (0 THRU 75000='A') (75001 THRU HI='B') INTO NSAL.
EXECUTE.

Where have I done mistake?

1
What's the error message? - Rowland Shaw
@RowlandShaw THE ERROR MESSAGE IS : >Error # 4382 in column 38. Text: SAL >An equals sign was not found when expected after a target variable in a >COMPUTE command. >Execution of this command stops. EXECUTE. - user 31466

1 Answers

3
votes

You can not use IF and RECODE together in one command. Try DO IF instead.

STRING NSAL (A8).

DO IF (EDU>12 AND GENDER='M').
RECODE SAL (0 THRU 75000='A') (75001 THRU HI='B') INTO NSAL.
END IF.

EXECUTE.