title: SAS - Overwriting a dataset open in ViewTable
body: <p>Is there a way to replace a data set which is currently open in the ViewTable Window?</p>
  
  <p>For example, say I create the following data set:</p>
  
  <pre><code>data the_meaning_of_life;
    is = 2;
  run;
  </code></pre>
  
  <p>I open it up and notice, oh drat!, I made a typo! I correct the code and rerun it.</p>
  
  <pre><code>data the_meaning_of_life;
    is = 42;
  run;
  </code></pre>
  
  <p>I'm then met with the following message,</p>
  
  <pre><code>ERROR: You cannot open WORK.THE_MEANING_OF_LIFE.DATA for output access with member-level
  control because WORK.THE_MEANING_OF_LIFE.DATA is in use by you in resource environment
  ViewTable Window.
  </code></pre>
  
  <hr>
  
  <p>Of course there are workarounds.  In the <code>keys</code> menu, I could bind </p>
  
  <pre><code>next viewtable:libref.dataset;end;
  </code></pre>
  
  <p>to an <code>F</code> key or prefix the submit button with it so that all VTs are closed before code is submitted.</p>
  
  <p>I recognize that there's an assumption I'm making.  I'm assuming that because the ViewTable Window is called a "ViewTable" that it is indeed a view.</p>
  
  <p>According to <a href="http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n07vq6hmss6f67n1vhnnn5cw0chh.htm" rel="nofollow noreferrer">SAS</a>, a view is</p>
  
  <blockquote>
    <p>a definition of a virtual data set that is named and stored for later
    use. A view contains no data; it merely describes or defines data that
    is stored elsewhere.</p>
  </blockquote>
  
  <p>A view should be independent of the data set.  It seems like the ViewTable opened when a data set is double-clicked in the SAS Explorer is not a 'true' view.  So maybe my question should be revised to,</p>
  
  <p>How do I view a data set as a view?</p>