logical operators

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

dogfriend11
Posts: 1
Joined: Tue Aug 23, 2011 8:16 pm

logical operators

Postby dogfriend11 » Tue Aug 23, 2011 8:22 pm

Hi,

I've noticed frequently when coding SPSS that, if A B and C are variables, it won't allow me to code:

IF (A=(B | C)) DO SOMETHING...

Error # 4321 in column 60. Text: )
>One of the operands of a logical operator (AND, OR, and NOT) is neither a
>logical expression nor a logical function nor a logical variable.
>This command not executed.

Instead I have to code:

IF (A=B | A=C) DO SOMETHING...

Is there a way to code an equal to/or statement? It's not a large problem in the example above, but if a variable could be equal to 10 other variables, it becomes very complicated. Is there a way to cimplify this operation?

Thanks.
ramiav
Posts: 6
Joined: Sun Sep 28, 2008 11:43 am

Re: logical operators

Postby ramiav » Sun Aug 28, 2011 7:11 am

if any(a,b,c) do something good...

Who is online

Users browsing this forum: No registered users and 2 guests

cron