title: Delete SAS dataset
body: <p>I have several datasets that I would like to delete after my SAS procedure has finished.  I am using this statement:</p>
  
  <pre><code>proc datasets lib=temp;
      delete xtemp2&amp;sysparm trades&amp;sysparm tickers&amp;sysparm;
  quit;
  run;
  </code></pre>
  
  <p>where</p>
  
  <p><code>&amp;sysparm</code> evaluates to a number and <code>temp</code> to a <code>libname</code>.  However, I receive the following errors in the log file:</p>
  
  <pre><code>142             delete xtemp2&amp;sysparm trades&amp;sysparm tickers&amp;sysparm;
              ______
              180
  ERROR 180-322: Statement is not valid or it is used out of proper order.
  </code></pre>
  
  <p>Anyone know the issue?</p>
  
  <p>EDIT:</p>
  
  <pre><code>Here is some more of the log file to address the answer:
  NOTE: "OUT_CSV" file was successfully created.
  NOTE: PROCEDURE EXPORT used (Total process time):
        real time           0.27 seconds
        cpu time            0.12 seconds
  
  
  142             delete xtemp2&amp;sysparm trades&amp;sysparm tickers&amp;sysparm;
          ______
          180
  ERROR 180-322: Statement is not valid or it is used out of proper order.
  </code></pre>
  
  <p>Here is the code immediately prior to the proc:</p>
  
  <pre><code>proc export data=temp.xtemp2&amp;sysparm outfile=out_csv dbms=csv replace;
  run;
  
  proc datasets lib=temp;
      delete xtemp2&amp;sysparm trades&amp;sysparm tickers&amp;sysparm;
  quit;
  run;
  </code></pre>