CONVERT (schema command)
The CONVERT command allows you to confirm or alter the types of the mentioned variables, to ensure they have the expected type later in the script.
Only in cases of converting to categorical is it possible to indicate which codes should be assigned to each of the values of the original column.
In situations where the input variables are the same as the target type, it won’t fail and instead will work as a confirmation of the type.
If the input variable is a derived categorical variable, it will return an error since it’s not possible to perform casting with options to a derived variable.
alias, ..., alias TO (CATEGORICAL|NUMERIC|TEXT) [WITH "label" TO code [MISSING], ..., "label" TO code [MISSING]];
CONVERT var1, var2 TO NUMERIC; CONVERT var3, var4 TO CATEGORICAL WITH "a" TO 1, "b" TO 2;