How to populate all dates between two date in SAS?




I am performing day wise sales analysis. Here, I have transaction table with “sale_date” variable. Data available in the transaction table was for period of 01Jan2010 to 31Dec2013. In this data set, there is missing entries for some dates due to holiday or no transaction.

Here, I want to generate records for all dates between date 01Jan2010 to 31Dec2013 with zero value for Sales. Please help me to achieve this in SAS.



This looks like a straight forward task. This is what I would have done :

  1. Create a table with all dates between 01Jan2010 and 31Dec2013
  2. Join your sales table with our newly created table using PROC SQL ( to get a cartesian product).
  3. Now standardize the merged table to impute all missing values by zero.

Hope this helps.