for current month i want the output to equal num_0 but for future months i want it to equal to past months Num_1.
data have;
input id num_0 date:date9. num_1 ;
format date date9.;
datalines;
1 20 06JAN2019 50
1 20 13JAN2019 50
1 20 20JAN2019 50
1 20 27JAN2019 50
1 20 03FEB2019 100
1 20 10FEB2019 100
1 20 17FEB2019 100
1 20 24FEB2019 100
1 20 03MAR2019 150
1 20 10MAR2019 150
1 20 17MAR2019 150
1 20 24MAR2019 150
;
run;
output i want :
id num_0 date num_1 num_2
1 20 06JAN2019 50 20
1 20 13JAN2019 50 20
1 20 20JAN2019 50 20
1 20 27JAN2019 50 20
1 20 03FEB2019 100 50
1 20 10FEB2019 100 50
1 20 17FEB2019 100 50
1 20 24FEB2019 100 50
1 20 03MAR2019 150 100
1 20 10MAR2019 150 100
1 20 17MAR2019 150 100
1 20 24MAR2019 150 100