SELECT IF command in SPSS syntax

#1
Dear all,
I am having some difficulties with the SELECT IF command. Please find attached screenshots of my syntax:
Syntax: https://www.dropbox.com/s/6stdc2j6eg1ppfj/image002.png

Dataset: https://www.dropbox.com/s/6me11wxp15f0cp1/image001.pnghttps://www.dropbox.com/s/6me11wxp15f0cp1/image001.png

I want to only select cases that either have the property (hypobegin=1 & hypoend~= 1) or (hypoend= 1 AND hypobegin ~= 1), marked in green in my screenshot.

However, I do not want to select cases where (hypobegin = 1 AND hypoend= 1), marked in red in my screenshot.

Therefore, I wrote the following the following:
SELECT IF ((hypobegin = 1 AND hypoend~= 1) OR (hypoend= 1 AND hypobegin ~= 1). See syntax screenshot for reference.

However, when run, only an empty dataset appears.

Any solutions?
 
#2
Not equal to does not apply to system missing values. In your syntax no cases can be matched and the select if command drops unmatched cases, thus you end up with an empty dataset. Unless you truly want non-matching cases removed from your dataset you should use filter instead of select if.

Assuming from your example that hypobegin and hypoend are dichotomous variables, the following should do what you want:

Code:
comp hypofilter = sum(hypobegin, hypoend) eq 1.
filter by hypofilter.
exe.