LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 28 Feb 2005 21:51:08 -0300
Reply-To:     Hector Maletta <hmaletta@fibertel.com.ar>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Hector Maletta <hmaletta@fibertel.com.ar>
Subject:      Re: eliminate records where the person was re-admitted on the
              same day that they were discharged
Comments: To: Thara Vardhan <Thara.Vardhan@djj.nsw.gov.au>
In-Reply-To:  <s22455b3.082@csogw2.djj.nsw.gov.au>
Content-Type: text/plain; charset="us-ascii"

Thara: 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 precedent entry.

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.

Hector

> -----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. > > regards > thara > > > 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. >


Back to: Top of message | Previous page | Main SPSSX-L page