pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting DO IF command error


From: Jill Covert
Subject: getting DO IF command error
Date: Mon, 9 Apr 2012 15:52:58 -0700

Hi,
 
I've tried the following DO IF commands without success (I'm able to run the means correctly, but do not get a sysmis for those where CoeMis is > 2):
 
DO IF CoeMis=0 or CoeMis=1 or CoeMis=2.
COMPUTE MeanCoe2 = SUM(OE15, OE16, OE17, OE18, OE19, OE20, OE21)/(7-CoeMis).
ELSE MeanCoe2=sysmis.
END IF.
DO IF CoeMis=0 or CoeMis=1 or CoeMis=2.
COMPUTE MeanCoe2 = SUM(OE15, OE16, OE17, OE18, OE19, OE20, OE21)/(7-CoeMis).
ELSE IF CoeMis>2 MeanCoe2=sysmis.
END IF.
 
DO IF CoeMis=0 or CoeMis=1 or CoeMis=2.
COMPUTE MeanCoe2 = SUM(OE15, OE16, OE17, OE18, OE19, OE20, OE21)/(7-CoeMis).
ELSE CoeMis>2 MeanCoe2=sysmis.
END IF.

DO IF CoeMis=0 or CoeMis=1 or CoeMis=2.
COMPUTE MeanCoe2 = SUM(OE15, OE16, OE17, OE18, OE19, OE20, OE21)/(7-CoeMis).
ELSE MeanCoe2 (sysmis).
END IF.
 
Error message in Output for the first attempt--others are similar--expecting end of command at MeanCoe2:
DO IF CoeMis = 0 or CoeMis=1 or CoeMis=2.
COMPUTE  MeanCoe2 = SUM(OE15, OE16, OE17, OE18, OE19, OE20, OE21)/(7-CoeMis).
R:\EVALUA~1\CBOEXC~1\Data\Syntax\TP-OE.sps.6-13: error: ELSE: Syntax error at
`MeanCoe2': expecting end of command.
ELSE MeanCoe2=sysmis.
END IF.
 
I also wasn't able to simply write:
DO IF CoeMis < 3.
but at least got it to work writing out each number.
 
If anyone can point out my error, I would much appreciate it! And if you need more info, please let me know.
 
Thank you!
Jill
 
We know how to organize warfare, but do we know how to act when confronted with peace?

    -- Jacques-Yves Cousteau (1910-1997)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]