Date: Thu, 8 Jan 2004 11:09:48 -0700
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: Working with dates
Content-Type: text/plain; charset=us-ascii
I'm curious why you code in all upper case. There are advantages to all
lower case (easier to type and read) and mixed case (easier to read; can
make keywords, and lexemes in variable names, stand out). But what's
the advantage of all upper case?
--
JackHamilton@FirstHealth.com
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "Greg Woolridge" <greg.woolridge@TAP.COM> 01/08/2004 6:55 AM >>>
Here is one untested solution.
DATA NEW;
SET OLD;
BY PT BEGIN;
RETAIN FLAG;
IF FIRST.PT THEN FLAG=0;
IF FLAG=1 THEN DELETE;
IF END='300CT2003'D THEN FLAG=1;
DROP FLAG;
RUN;
Greg M. Woolridge
Manager, Study Programming
TAP Pharmaceutical Products Inc.
e-mail: greg.woolridge@tap.com
phone: 847-582-2332
fax: 847-582-2403
Jennifer R
Popovic To:
SAS-L@LISTSERV.UGA.EDU
<PopovicJ@GAO.GOV cc:
> Subject: Working with
dates
Sent by: "SAS(r)
Discussion"
<SAS-L@LISTSERV.U
GA.EDU>
01/08/2004 08:16
AM
Please respond to
Jennifer R
Popovic
I have a dataset of begin and end dates of an event, multiple events
per
person. I've pasted an example of one person's data below (sorted by
begin date). What I need to do for each person is to make the first
obs
with an END date of 10/30/2003 the last observation for that person.
So
for the person below, the fifth obs would be the last b/c I'd want to
delete the last three obs.
I know there must be an easy way to do this, but for some reason can't
seem to make it work. Any suggestions?
obs begin end
1 04/24/2001 04/28/2001
2 09/09/2001 12/19/2001
3 02/18/2002 03/29/2002
4 04/23/2002 04/27/2002
5 10/10/2002 10/30/2003
6 01/08/2003 01/09/2003
7 02/25/2003 10/30/2003
8 07/14/2003 10/30/2003
Thanks,
Jen