I have a data set that has duplicate values of v1. I would like v2 values to be replaced by the first value of v2.
Data one;
v1 v2
1 20
1 23
1 21
2 36
3 51
4 44
4 20
I would like data=one to be changed to this:
Data one;
v1 v2
1 20
1 20
1 20
2 36
3 51
4 44
4 44
what procedure do I need to use?
A data step will do (assuming the data is already sorted the way you want):