title: Looking back in SAS
body: <p>I have a data set of product sales and pricing that is sorted by product by week.  I want to create a data step that "looks back" 12 weeks from the current week and selects the maximum price for that product.  The 12 week "look back" period would then move forward as the data step progresses.</p>
  
  <p>Is this possible?</p>
  
  <p>Also, i'm NOT a sas coder.  Simple data steps are my speed.</p>
  
  <p>I'm also a newbie here and do not know how to post data so I could use a quick pointer on how to do that and I'll update my post.</p>
  
  <p>Thanks</p>
  
  <p>Jeff</p>
  
  <pre><code>Item    Week    Units   Dollars Avg Price
  Item 1  2505    14  $315    $22.50 
  Item 1  2506    7   $166    $23.71 
  Item 1  2507    7   $100    $14.36 
  Item 1  2508    13  $387    $29.77 
  Item 1  2509    11  $231    $21.00 
  Item 1  2510    7   $168    $24.00 
  Item 1  2511    15  $397    $26.47 
  Item 1  2512    12  $222    $18.50 
  Item 1  2513    14  $453    $32.36 
  Item 1  2514    19  $557    $29.32 
  Item 1  2515    12  $369    $30.73 
  Item 1  2516    11  $272    $24.73 
  Item 1  2517    15  $462    $30.80 
  Item 1  2518    9   $160    $17.78 
  Item 1  2519    15  $404    $26.93 
  Item 1  2520    17  $382    $22.47 
  Item 1  2521    4   $129    $32.25 
  Item 1  2522    9   $219    $24.33 
  Item 1  2523    8   $274    $34.22 
  Item 1  2524    30  $685    $22.83 
  Item 1  2525    25  $607    $24.28 
  Item 1  2526    15  $430    $28.67 
  Item 1  2527    19  $445    $23.42 
  Item 1  2528    11  $295    $26.81 
  Item 1  2529    14  $356    $25.43 
  Item 1  2530    17  $396    $23.32 
  Item 1  2531    13  $340    $26.15 
  Item 1  2532    13  $329    $25.31 
  Item 1  2533    8   $240    $30.00 
  Item 1  2534    10  $230    $23.00 
  Item 1  2535    6   $268    $44.67 
  </code></pre>