title: Creating dummy rows in SAS from last entry date to specified date
body: <p>Suppose I have the following SAS dataset:</p>
  
  <pre><code>Account  Month  Balance  LastMonth   MonthDate    LastMonthDate
  1        Jan    5        May         2012-01-01  2012-05-01
  1        Feb    2        May         2012-02-01  2012-05-01
  1        Mar    1        May         2012-03-01  2012-05-01
  2        Feb    6        Apr         2012-02-01  2012-04-01
  2        Mar    4        Apr         2012-03-01  2012-04-01
  </code></pre>
  
  <p>I need to create the following:</p>
  
  <pre><code>Account  Month  Balance  LastMonth   MonthDate    LastMonthDate
  1        Jan    5        May         2012-01-01  2012-05-01
  1        Feb    2        May         2012-02-01  2012-05-01
  1        Mar    1        May         2012-03-01  2012-05-01
  1        Apr    1        May         2012-04-01  2012-05-01
  1        May    1        May         2012-05-01  2012-05-01
  2        Feb    6        Apr         2012-02-01  2012-04-01
  2        Mar    4        Apr         2012-03-01  2012-04-01
  2        Apr    4        Apr         2012-04-01  2012-04-01
  </code></pre>
  
  <p>That is, I need to add additional rows, per account, so that each account has an entry for every month up to the 'LastMonth' column. For the months which are not in the original dataset, the balance must be kept constant with that of the last entry in the dataset. My dataset is already sorted by 'Account' and 'Month'.</p>
  
  <p>Note that these are just two sample accounts, as my real dataset has multiple accounts, each with different 'LastMonth' columns. I need this process to be generalized so that this will create the number of missing lines for every account up to its' 'LastMonth' date.</p>
  
  <p>Edit: The 'MonthDate' and 'LastMonthDate' are stored as follows:
  <a href="https://i.stack.imgur.com/Z2Tlk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z2Tlk.png" alt="enter image description here"></a></p>