I am using the SPSS syntax editor to combine string variables. I know that there will be data in one or zero of the variables for each record, but there will never be data in both variables. This is my code, and the problem is with the first line:
IF (MISSING(ywFamilyPlayers)=1) AND (MISSING(vywFamilyPlayersBoolean)=1) THEN newString=missing.
IF (MISSING(ywFamilyPlayers)=0) newString=VALUELABEL(ywFamilyPlayers).
IF (MISSING(vywFamilyPlayersBoolean)=0) newString=VALUELABEL(vywFamilyPlayersBoolean).
EXECUTE.
I cannot figure out how to assign the system missing value to the string variable when it matches the logical conditions. I can easily assign nonsense text (e.g. "-999" or "") under those conditions, but the system won't treat it as a true missing value when running tests on the data.
Can you help me out? The logic works, but I just cannot figure out how to assign the missing value. I've experimented with many permutations (e.g. $sysmis and MISSING) but to no avail.