I am working on SAS and the data I have is this using SAS data step or proc sql...
ID date
1 1-jan-2010
1 1-jan-2010
1 1-jan-2014
2 1-jan-2011
2 1-jan-2011
3 1-jan-2011
3 1-jan-2019
3 1-jan-2020
3 1-jan-2021
I want to create a new var called var_new which will take a running number for each group of ID and date. I don´t want to delete the duplicates.
ID date var_new
x 1-jan-2010 1
x 1-jan-2010 1
x 1-jan-2014 2
y 1-jan-2011 1
y 1-jan-2011 1
y 1-jan-2011 1
z 1-jan-2019 1
z 1-jan-2020 2
z 1-jan-2021 3
z 1-jan-2022 4
Please help!!