Date: Mon, 5 Feb 2007 15:01:47 -0600
Reply-To: "Oliver, Richard" <roliver@spss.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Oliver, Richard" <roliver@spss.com>
Subject: Re: Syntax question
In-Reply-To: A<ff4054b20702051130t4b5ccc67ke9ef96f9867ce24c@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
That is a bit circuitous and creates a "filter" variable that is then used to delete rather than filter cases. Two alternatives:
*filter instead of delete unselected cases.
compute filterVar=(year_var >= 1990 and year_var <= 2006).
filter by filtervar.
*delete unselected cases.
select if year_var >= 1990 and year_var <= 2006.
If year is a component of a date variable (e.g., mm/dd/yyyy), you can extract the date portion with the XDATE.YEAR function, as in
compute filtervar=(xdate.year(year_var) >= 1990
and xdate.year(year_var) <= 2006).
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Carlos Renato
Sent: Monday, February 05, 2007 1:30 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: Syntax question
Dear Friend
Use this syntax to solve your doubt.
RECODE
Your_Year_Variable
(1990 thru 2000=1) (ELSE=0) INTO filter .
EXECUTE .
FILTER OFF.
USE ALL.
SELECT IF(NOT(filter =0)).
EXECUTE .
Carlos Renato
Statistician
Recife-PE-Brazil
2007/2/5, stace swayne <jladyl@yahoo.com>:
> Dear list,
>
> I have a data set with the years 1990 through 2006, I would like to select the years 1996 through 2000 and I'm not sure how to write the syntax.
>
> All suggestions are welcomed.
>
> Thanks
>
>
> ---------------------------------
> No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
>