=========================================================================
Date: Sat, 22 Jul 2006 13:05:00 -0500
Reply-To: james.moffitt@thomson.com
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Jim Moffitt <james.moffitt@thomson.com>
Subject: Re: Compound IF syntax
In-Reply-To: <200607221208.AA544276528@Applied-insights.co.uk>
Content-Type: text/plain; charset="us-ascii"
John:
Your code seems to work just fine. Thanks so much for your help.
-----Original Message-----
From: John McConnell [mailto:jmcconnell@Applied-insights.co.uk]
Sent: Saturday, July 22, 2006 12:09 PM
To: SPSSX-L@LISTSERV.UGA.EDU; Moffitt, James (West)
Subject: Re: Compound IF syntax
Jim,
I can't test this at the moment but it sounds like a job for COUNT.
Something like
COUNT N1S=Q1 to Q26 (1).
COUNT N0S=Q1 to Q26 (0).
IF N1S EQ 0 AND N0S GE 1 SAM=0.
hth
John
John McConnell
Applied Insights
---------- Original Message ----------------------------------
From: Jim Moffitt <james.moffitt@thomson.com>
Reply-To: james.moffitt@thomson.com
Date: Sat, 22 Jul 2006 10:39:00 -0500
>I have 6 contiguous variables named q1-q26.
>
>For all 200 of my cases all twenty-six of those variables contain
>either a system missing dot, a 1, or a zero.
>
>I have another variable named Sam.
>
>For all 200 of my cases Sam currently contains either a system missing
>dot or a 1.
>
>How do I write a syntax line that says for every case in which none of
>the values in any of the twenty-six contiguous variables are 1 and any
>of the values in those twenty-six contiguous variables are zero, set
>the value of Sam to 0?
>
>Thanks for your help.