From: Al on
Dear All:

I have the following dataset with duplicates.. I am supposed to write
the duplicate values to a dataset .. and unique value to another
dataset ..

Patid test day res
1 ALT 1 12
1 ALT 1 14
1 ALT 2 10
1 ALT 3 11
1 AST 4 09
1 AST 5 16
1 AST 5 11

2 ALT 1 12
2 ALT 1 14
2 ALT 2 11
2 AST 3 09
2 AST 4 16
2 AST 4 11


Can anyone provide suggestions

Thanks in advance
Al


From: Mo Yang on
On Apr 6, 11:18 am, Al <ali6...(a)gmail.com> wrote:
> Dear All:
>
> I have the following dataset with duplicates..  I am supposed to write
> the duplicate values to a dataset .. and unique value to another
> dataset ..
>
> Patid   test  day  res
>  1          ALT   1      12
>  1          ALT   1      14
> 1           ALT   2      10
> 1           ALT    3      11
> 1          AST    4      09
> 1          AST    5      16
> 1         AST     5     11
>
>  2         ALT   1      12
>  2         ALT   1      14
> 2         ALT    2      11
> 2         AST    3      09
> 2         AST    4      16
> 2        AST     4     11
>
> Can anyone provide suggestions
>
> Thanks in advance
> Al

Proc sort by Patid test and use first.patid and last.patid to fine
duplicate records, and use proc sort option nodupkey to output nondup
records.
From: Reeza on
On Apr 6, 9:18 am, Al <ali6...(a)gmail.com> wrote:
> Dear All:
>
> I have the following dataset with duplicates..  I am supposed to write
> the duplicate values to a dataset .. and unique value to another
> dataset ..
>
> Patid   test  day  res
>  1          ALT   1      12
>  1          ALT   1      14
> 1           ALT   2      10
> 1           ALT    3      11
> 1          AST    4      09
> 1          AST    5      16
> 1         AST     5     11
>
>  2         ALT   1      12
>  2         ALT   1      14
> 2         ALT    2      11
> 2         AST    3      09
> 2         AST    4      16
> 2        AST     4     11
>
> Can anyone provide suggestions
>
> Thanks in advance
> Al

Also check nodupkey and dupout which will output a list of duplicate
observations ie the set of duplicates removed. Your other dataset
have a list of unique values and the dupout dataset will have the
duplicate values. Depends on what you want....or run a proc freq with
the appropriate tables and by statement that will count how many of
each observation is in the data set.