Ok so that did not work exactly as expectedbut with your help on identifying this is an offshoot of Last observation carry-forward...I was able to work with SAS and get the following results. This one creates a temporary dataset and fills in the missing data as expected..Thank you for all the help and I hope this data step helps others who are struggling data cards; infile datalines delimiter=','; input Dates $ activeflg_final UnitLossThisMTHPred Unit_Loss_Perc; datalines; Mar18,19202,11,0.017 Apr18,11873,9,0.017 May18, , ,0.015 Jun18, , ,0.018 Jul18, , ,0.015 Aug18, , ,0.017 ; run; data sample1; retain activeflg_lag temp_activeflg temp_unitloss; set cards; if activeflg_final ne . then do; temp_activeflg=activeflg_final; temp_unitloss=unitlossthismthpred; end; if activeflg_final=. then do; temp_unitloss= activeflg_lag * Unit_Loss_Perc; temp_activeflg = activeflg_lag - temp_unitloss; activeflg_final=temp_activeflg; unitlossthismthpred=temp_unitloss; end; output; activeflg_lag=temp_activeflg; drop activeflg_lag temp_activeflg temp_unitloss; run; proc print; var Dates activeflg_final UnitLossThisMTHPred Unit_Loss_Perc; run;
... View more