SELECT IF command in SPSS syntax

Dear all,
I am having some difficulties with the SELECT IF command. Please find attached screenshots of my syntax:


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?
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:

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