|
On Wed, 4 Apr 2007 12:09:24 -0700, sdlenter <sdlentert@AOL.COM> wrote:
>Using Proc SQL
>I have a file and I need to work with duplicates only:
>Example:
>I need to Count duplicates by Movie (actress, actor, song and money)
>so the four fields (actress, actor, song and money) have to match.
>
>the non-duplicate fields I need to extract into a seperate file....
Test data:
data have;
input actress actor song money;
cards;
1 1 1 1
2 2 2 2
1 1 1 1
;
Then, in the PROC SQL step:
create table multiple as
select *, count(*) as many from have
group by actress, actor, song, money
having many gt 1;
create table single as
select * from have
group by actress, actor, song, money
having count(*) eq 1;
|