I have a dataset that looks like this:
| ID |
group |
|
| 1 |
AB |
|
| 1 |
AB |
|
| 2 |
CD |
|
| 2 |
CD |
|
| 3 |
CD |
|
| 3 |
CD |
|
| 4 |
EF |
|
What i would like to do see assign 1 for unique ID with group . if it is repeated more than once, then 0
something else this
| ID |
group |
count |
| 1 |
AB |
1 |
| 1 |
AB |
0 |
| 2 |
CD |
1 |
| 2 |
CD |
0 |
| 3 |
CD |
1 |
| 3 |
CD |
0 |
| 4 |
EF |
1 |
i was thinking to do proc sql like proc sql; select distinct id, group, 1 as count; quit;
but was wondering if there is a simple dataset command where i dont have to create another dataset
thanks!
d