| Date: | Thu, 17 Mar 2011 10:12:43 -0700 |
| Reply-To: | "Terjeson, Mark" <Mterjeson@RUSSELL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Terjeson, Mark" <Mterjeson@RUSSELL.COM> |
| Subject: | Re: Flagging Duplicates |
|
| In-Reply-To: | A<201103171704.p2HFiiTI028001@waikiki.cc.uga.edu> |
| Content-Type: | text/plain; charset="us-ascii" |
Hi Randy,
Yes that is correct.
Your 1 flags the first occurance of each group.
Your 0 flags the duplicates (within each group).
Hope this is helpful.
Mark Terjeson
Investment Business Intelligence
Investment Management & Research
Russell Investments
206-505-2367
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Randy
Sent: Thursday, March 17, 2011 10:04 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Flagging Duplicates
I have a large data set and I need to flag duplicates
The data set is as follows:
IDA
1
1
1
2
3
3
4
I want the data set as follows:
IDA flag_dup
1 1
1 0
1 0
2 1
3 1
3 0
4 1
My code is as follows. Is it correct?
data want ; set have ;
by IDA ;
if first.IDA then flag_Dup = 1 ; else flag_dup = 0 ;
run;
|