there are two point, the second probably yielding a different
(correct?) result in your case.
1) with do-if-s the first true condition determines which
part of the syntax gets executed, ignoring all other parts.
with if-s all true conditions are executed in the
sequence they are written
2) with do-if-s, if a condition can't be evaluatet due to
missing values, spss skips pcorcessing until after end-if
So with do-if, if bdbj(#i) or bdpn(#i) are missing, processing
skips to after end-if, ignoring your 2nd and 3rd condition,
while the 2nd and 3rd if in your if-sequence gets evaluated.
Von: Jed J. Teres [mailto:email@example.com]
Gesendet: Mittwoch, 30. Juli 2003 16:09
Betreff: do if vs if
Can someone please explain the difference between "do if" and just regular
"if" for me?
I tried to use the following syntax, and if failed:
do if (bdpj(#i) lt 3 AND bdpn(#i) lt 2).
else if (bdpj(#i) lt 3 AND missing(bdpn(#i)))
else if (missing(bdpj(#i)) AND bdpn(#i) ge 2)
But the following worked fine. I'm coming from a MATLAB background, and I
don't see a difference... what -is- the difference?
if (bdpj(#i) lt 3 AND bdpn(#i) lt 2)
if (bdpj(#i) lt 3 AND missing(bdpn(#i)))
if (missing(bdpj(#i)) AND bdpn(#i) ge 2)
Weill Medical College of Cornell University
Department of Psychiatry
525 East 68th Street
New York, NY 10021