Hi, I have dataset which has the format as shown in the code below. I would like to replace the missing data for andate by the same value up until new andate. So given the first andate in example is 15714, I want to replace all missing up to the new andate by 15714 and afterwards the second andate 15742 so I want to replace all missing after it by this date and then do this for all andates. Thanks in advance for any help



Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int date float andate
15706     .
15707     .
15708     .
15711     .
15712     .
15713     .
15714 15714
15715     .
15718     .
15719     .
15720     .
15721     .
15722     .
15725     .
15726     .
15727     .
15728     .
15729     .
15732     .
15733     .
15734     .
15735     .
15736     .
15739     .
15740     .
15741     .
15742 15742
15743     .
15746     .
15747     .
15748     .
15749     .
15750     .
15753     .
15754     .
15755     .
15756     .
15757     .
15760     .
15761     .
15762     .
15763     .
15764     .
15767     .
15768     .
15769     .
15770 15770
15771     .
15774     .
15775     .
15776     .
15777     .
15778     .
15781     .
15782     .
15783     .
15784     .
15785     .
15788     .
15789     .
15790     .
15791     .
15792     .
15795     .
15796     .
15797     .
15798 15798
15799     .
15802     .
15803     .
15804     .
15805     .
15806     .
15809     .
15810     .
15811     .
15812     .
15813     .
15816     .
15817     .
15818     .
15819     .
15820     .
15823     .
15824     .
15825     .
15826     .
15827     .
15830     .
15831     .
15832     .
15833 15833
15834     .
15837     .
15838     .
15839     .
15840     .
15841     .
15844     .
15845     .
end
format %td date
format %td andate