Hello,
I am a new SAS user.
I want to calculate the date difference by group
I have the following data:
Company_ID Date
1001 05JAN2021
1001 06JAN2021
1001 07JAN2021
1001 08JAN2021
1001 11JAN2021
1002 18FEB2021
1002 21FEB2021
1002 22FEB2021
I want the following output:
Company_ID | Date | Date_Diff |
1001 | 2021-01-05 | . |
1001 | 2021-01-06 | 1 |
1001 | 2021-01-07 | 1 |
1001 | 2021-01-08 | 1 |
1001 | 2021-01-11 | 3 |
1002 | 2021-02-18 | . |
1002 | 2021-02-21 | 3 |
1002 | 2021-02-22 | 1 |
Thank you so much for your kind support!