SPSS Recode
Numeric Variables
String Variables
Values are compared to recode instructions with an implicit rtrim call (i.e. trailing whitespace is not compared).
SPSS will also emit a warning if a recode instruction includes a value that is too long to possibly be found within the variable.
Type Conversion
To convert a numeric variable into a string, try:
recode numeric_zip_code (0="NULL") (sysmis="") (convert) into string_zip_code.
Note that specific values can be handled differently by including a recode instruction ahead of the convert instruction.
To convert a string variable into a number, try:
recode string_zip_code ("NULL"=0) (""=sysmis) (convert) into numeric_zip_code.
Note that non-numeric values (including blank values) must be handled explicitly by including a recode instruction ahead of the convert instruction, or they will all be replaced with the system missing value and a warning will be emitted.