I want to compare the value of a variable against a list of string values. The strings are UK postcodes, of this format: "E1 1DT". If I include a value like this "E1 1EE" SPSS tries to treat the 1EE part as an exponential number, and gives an error message, even though the string is in quotes.
Here is a short syntax:
string pcc (a8).
compute pcd=0.
do repeat pcc="E1 1DT", "E1 1DU", "E1 1DW", "E1 1EE", "E1 1EG".
if (postcodecopy eq pcc) pcd=1.
end repeat.
execute.
This is the error message:
>Warning # 203 in column 63. Text: 1E
>An 'E', beginning the exponent portion of a number, was not followed by any
>digits.
>The symbol will be treated as an invalid special character.
It ends with this:
>Error # 4001. Command name: end repeat
>An END REPEAT command has appeared without a previous DO REPEAT command.
>Execution of this command stops.
execute.
Any suggestions?
------------------------------
Charlie Owen
------------------------------
#SPSSStatistics