Use PROC FREQ, result will be in the WANT data set.
proc freq data=have noprint;
table id*date / out=want list;
run;
@knighsson wrote:
Hello
I want to combine the same date together and calculate how many days, could you please let me know how to do this?
The original dataset
ID |
DATE |
XX |
YY |
1 |
04/10/13 |
|
|
1 |
04/10/13 |
|
|
1 |
05/10/13 |
|
|
1 |
06/10/13 |
|
|
2 |
04/10/13 |
|
|
2 |
04/10/13 |
|
|
2 |
04/10/13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
the ideal dataset
ID |
DATE |
number of same date |
YY |
1 |
04/10/13 |
2 |
|
1 |
05/10/13 |
1 |
|
1 |
06/10/13 |
1 |
|
2 |
04/10/13 |
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|