title: How do i perform calculation about the last n observations
body: <p>how can i perform calculation for the last n observation in a data set
  For example if I have 10 observations I would like to create a variable that would sum the last 5 values of another variable. Please do not suggest that I lag 5 times or use module ( <em>N</em> ). I need a bit more elegant solution than that.</p>
  
  <p>with the code below alpha is the data set that i have and bravo is the one i need.</p>
  
  <pre><code>data alpha; 
      input lima @@ ;
      cards ;
  3 1 4 21 3 3 2 4 2 5
  ; 
  run ;
  
  data bravo;
  input lima juliet;
  cards;
  3 .
  1 .
  4 .
  21 .
  3 32
  3 32
  2 33
  4 33
  2 14
  5 16
  ;
  run;
  </code></pre>
  
  <p>thank you in advance!</p>