|
The OP wrote me offline and indicated:
"I want the term date to be . (as it shows up on the duplicate Row 3)...
so if there is a duplicate - grab EFFDate from the first one (earliest) and
Termdate from the second one (latest or missing)."
Unless someone has a better idea, I would just do it in a data step using
first. and last. E.g.,
data have;
infile datalines dsd missover;
input ID effdate termdate;
informat effdate mmddyy10.;
informat termdate mmddyy10.;
format effdate termdate date9.;
datalines;
1,10/14/2009,.
6,08/01/2008,01/02/2012
6,10/14/2009,.
;
proc sort data=have;
by descending id effdate;
run;
data want (drop=first_effdate);
set have (rename=(effdate=first_effdate));
retain effdate;
format effdate date9.;
by descending id;
if first.id then effdate=first_effdate;
if last.id then output;
run;
HTH,
Art
---------
On Thu, 3 Dec 2009 07:46:45 -0800, Sdlentertd <sdlentertd@GMAIL.COM> wrote:
> have this dataset
>ID EFFDATE TERMDATE
>1212 10/14/2009 .
>625 08/01/2008 10/14/2009
>625 10/14/2009 .
>
>I need to remove duplicates but leave the duplicate's Original
>EFFDATE
>there. The dataset will look like this:
>
>
>ID EFFDATE TERMDATE
>1212 10/14/2009 .
>625 08/01/2008 .
>
>
>manupulating duplicate's dates Only. Duplicate is based on ID field
>only. P.S. Sorting a and resorting does NOT work, it leaves the old
>date in, but I need for EFFDate to be taken from one duplicate reccord
>and TERMDATE to be taken from the other duplicate record.
>Thank you
|