by armyid date;
run;
data result;
set temp;
by armyid ;
start=lag(date);end=date;
_rank=lag(rank);_pay=lag(pay); r=rank;p=pay;
if first.armyid then output;
else do;
output;
do i=start+1 to end-1;
date= i;rank=_rank;pay=_pay;
output;
end;
end;
if last.armyid and (end lt '31dec2009'd ) then do;
do j=end+1 to '31dec2009'd ;
date=j; rank=r;pay=p;
output;
end;
end;
drop i j r p start end _: ;
run;
proc sort data=result;
by armyid date;
run;
[pre]
[/pre]
Ksharp
datalines;
103164
O-1 $8.20
103164
O-3 $8.70
103164
O-5 $10.25
475405
E-4 $15.35
475405
E-6 $18.40
475405
E-8 $22.90
589071
O-7 $14.10
589071
O-9 $19.65
589071
O-11 $28.80
NOTE: Data set
WORK.RESULT contains 1 observations not in WORK.DAYS.
NOTE: Values of the following 4 variables compare unequal: ARMYID DATE RANK
PAY
NOTE: The data sets WORK.RESULT and WORK.DAYS contain unequal values.
NOTE: There were 2838 observations read from the data set WORK.RESULT.
NOTE: There were 2837 observations read from the data set WORK.DAYS.
NOTE: PROCEDURE COMPARE used (Total process time):
real time
1.78 seconds
cpu time
0.10 seconds
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.