Date: Mon, 28 Feb 2005 21:51:08 -0300
Reply-To: Hector Maletta <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Hector Maletta <firstname.lastname@example.org>
Subject: Re: eliminate records where the person was re-admitted on the
same day that they were discharged
Content-Type: text/plain; charset="us-ascii"
The simplest syntax is as follows:
SELECT IF (personid=lag(personid) and admdate NE LAG(disdate)).
This selects all records where the two records belong to the same person and
the second admission date is not equal to the discharge rate in the
I recommend you save the working file (after this SELECT IF) under a new
name. Otherwise you will lose the deleted records forever, not a very clever
idea in general.
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]
> On Behalf Of Thara Vardhan
> Sent: Monday, February 28, 2005 9:45 PM
> To: SPSSX-L@LISTSERV.UGA.EDU
> Subject: eliminate records where the person was re-admitted
> on the same day that they were discharged
> Dear List members
> can you please help me with a syntax for the following problem
> I want to eliminate records where the person was re-admitted
> on the same day that they were discharged. I want to write
> the syntax that will delete record b.
> for example my data contains records like these
> Personid admdate disdate
> 17152 27-MAY-2003 18-JUL-2003
> 17152 18-JUL-2003 26-SEP-2003
> Looking forward to your reply.
> Thara Vardhan
> Senior Project Officer
> Research, Planning & Evaluation Branch
> Tel: (02) 9219-9515
> This message is intended for the addressee named and may
> contain confidential information. If you are not the
> intended recipient, please delete it and notify the sender.
> Views expressed in this message are those of the individual
> sender, and are not necessarily the views of the Department
> of Juvenile Justice.