Filling in empty values in a time series in SAS

In previous posts, I had shown how to insert zeroes in a times series in Python and R. This post shows how to do so in SAS; you can follow the links for Python and R to see more information on the underlying problem.
This solution uses base SAS, as I am using the free University Edition. The easiest way to do so would using PROC EXPAND, but doing so requires the SAS/ETS.

Similarly to the previous versions of this exercise, we build a data file with all dates for the year and join to the data containing mileage data.

Here is the SAS code for creating the time series and the plot of the mileage.

/* Read in file */
proc import datafile="/folders/myfolders/trk_2014_walk_sas.csv"
     out=exer_2014
     dbms=csv
     replace;
     getnames=yes;
run;

/* Sort prior to merge */
proc sort data=exer_2014;
	by ridedt;
run;

/* Create dataset with all dates for year */
data alldt ;
  do ridedt = '01JAN2014'd to '31DEC2014'd ;
    ridemiles=0;
    output ;
  end ;
  format ridedt mmddyys10.;
run ;

/* Merge the two dataset */
data merged;
merge alldt exer_2014;
by ridedt;
run;

/* Calculate cumulative totals  */
data total;
   set merged;
   TotalMiles + ridemiles;
run;
 
/*  Plot     */
proc sgplot data=total;
scatter x=ridedt y=TotalMiles;
run;

plot_walk_2014_sas