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 following observations
ID Salary Next_row_Salary
10 1000 2000
20 2000 3000
30 3000 4000
40 4000 null
Note: The scenario is next obersavtion's salary should be the current observation's value for the column Next_Row_salary.
If there is no next observation then the current observation's value for the column Next_Row_salary should be 'null'.
Kindly help me out in creating a sas code for this scenario.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…