Date: Mon, 28 Jan 2002 16:50:23 -0500
Reply-To: Boyd Newlin <bnewlin@INSMED.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Boyd Newlin <bnewlin@INSMED.COM>
Subject: Re: deleting duplicates
Content-Type: text/plain; charset="iso-8859-1"
If I understand you correctly, you want to place missing values in varA if
it's a duplicate id year?
If so, this should work.
proc sort data=x;
by id year;
by id year;
if not first.year then varA='.';
This will place a missing value in varA for every duplicate record of id and
Senior Programmer Analyst
Biostatistics and Programming
P.O. Box 2400
Glen Allen, VA 23058
From: Yvette [mailto:hollied@OLIN.WUSTL.EDU]
Sent: Monday, January 28, 2002 1:00 PM
Subject: deleting duplicates
I am tryin to write a line (or two) of code that will allow my data to
read if if this observation minus the next observation does not equal
zero then put a '.' Although I haven't been very successful.
I tried the if first.year command but it put missing variables for all
of my data beyond the first year. I want it to perform this function
by both ID and year - by this I mean I won't it to put a missing value
when not the first obs for the firm and year.
if not first.year for 1990 1991 and 1992 then put varA = '.'
I realixe the syntax is not correct but this is what I am trying to
Any help would be greatly appreciated.