I\'ve a dataset called \'input\' with the following observations
ID Salary
10 1000
20 2000
30 3000
40 4000
I need an output dataset with
There are a few ways to achieve this, here's how I would do it.
data have;
input ID Salary;
cards;
10 1000
20 2000
30 3000
40 4000
;
run;
data want;
recno=_n_+1;
set have end=last;
if not last
then set have (keep=salary rename=(salary=next_row_salary)) point=recno;
else call missing(next_row_salary);
run;