Date: Tue, 13 Dec 2005 10:08:43 -0500
Reply-To: Art@DrKendall.org
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Art@DrKendall.org>
Organization: Social Research Consultants
Subject: Re: matching text values with blanks
In-Reply-To: <439E3874.4050402@flinders.edu.au>
Content-type: text/plain; charset=us-ascii; format=flowed
does this work?
missing values hosp_1 hosp_2 hosp_3 hosp_4 ('"").
Art
Kylie Lange wrote:
> Hi all,
>
> I have some syntax that is used to find matching values of string
> variables. A positive 'match' is returned when any of the 'hosp'
> variables matches any of the 'death' variables. The syntax below works
> perfectly except that an empty value in one of the 'hosp' variables
> results in a positive match with an empty values in one of the 'death'
> variables (as the ANY function returns a 1). Can this be simply modified
> so that a blank value does not result in a match? (I can think of clumsy
> checks involving IF statements and so on but know that there would be a
> wonderfully simple way to do the same thing).
>
> DO REPEAT H = hosp_1 hosp_2 hosp_3 hosp_4 /M = match_1 match_2 match_3
> match_4.
> COMPUTE M = ANY(H, death_1, death_2, death_3, death_4).
> END REPEAT.
> COMPUTE match = ANY(1, match_1, match_2, match_3, match_4).
> EXE.
>
> Thanks,
> Kylie.
>
>
|