title: In SAS, are assigned variables always set to missing before each iteration?
body: <p>I am confused as to why this code works and I'm afraid that this is due to misunderstanding of how SAS processes datasets. I thought that the PDV is initialized to missing each iteration for variables created in an assignment statement, while all other variableare overwritten with each iteration. So, I expected Promotion to be missing with the second iteration because there is no RETAIN statement. When is a RETAIN statement needed and why is it not needed here? </p>
  
  <pre><code>DATA work.extended;
      SET Orion.Discount;
      WHERE Month(Start_Date)=7 OR Month(End_Date)=7;
      DROP Unit_Sales_Price;
      Promotion="Happy Holidays";
      Season="Winter";
      Output;
      Season="Summer";
      Output;
      RUN;
  </code></pre>
  
  <p>Here is a sample of the output:</p>
  
  <pre><code>Obs Product_ID Start_Date End_Date Discount Promotion Season
  1 210100100038 01JUL2007 31JUL2007 60% Happy Holidays Winter
  2 210100100038 01JUL2007 31JUL2007 60% Happy Holidays Summer
  3 210200100010 01JUL2007 31JUL2007 60% Happy Holidays Winter
  4 210200100010 01JUL2007 31JUL2007 60% Happy Holidays Summer
  </code></pre>
  
  <p>Thank you.</p>