REPLACE CATEGORICAL RECODE command
See Crunch Automation basics for more information.
You can use REPLACE within the CREATE CATEGORICAL RECODE command. The difference is that REPLACE does not include the AS... assignment at the end, which is used to indicate a new variable. Instead, the new variables are indicated at the beginning (before WHEN).
Everything else remains the same, including how it computes. The results are not stored on a new variable but instead overwrite the mentioned columns.
Syntax
REPLACE CATEGORICAL
RECODE alias,...,alias
WHEN condition THEN "label" [CODE value [MISSING]]
...
WHEN condition THEN "label" [CODE value [MISSING]]
[ELSE "string" [CODE value [MISSING]|ELSE INTO NULL]
END;Example
REPLACE CATEGORICAL
RECODE alias,...,alias
MAPPING
code|"label", ..., code|"label" INTO "label" [CODE value [MISSING]],
code|"label", ..., code|"label" INTO "label" [CODE value [MISSING]]
[ELSE "label" [CODE value [MISSING]]|ELSE INTO NULL];