title: SAS: use oberservation
body: <p>I have a question on how to use the value from a SAS database in another command. In my case, I have a database with two variables (cell and res). "Cell" contains a reference to a cell in an Excel sheet where the value of "res" should be copied.</p>
  
  <p>So I would like to use the value stored in "cell" in my command linking to the Excel sheet. This code does not work (concatenating with || does not work.)</p>
  
  <pre><code>DATA _null_; 
  SET test;
  FILENAME ExcelTmp DDE "EXCEL|[&amp;myInputTemplate.]&amp;mySheet.!" || cell;
  FILE ExcelTmp NOTAB LRECL=7000;
  PUT res;
  RUN;
  </code></pre>
  
  <p>Error message: </p>
  
  <pre><code>ERROR 23-2: Invalid option name ||.
  
  1491! DDE "EXCEL|[&amp;myInputTemplate.]&amp;mySheet.!" || cell;
  ERROR: Error in the FILENAME statement.
  ERROR 23-2: Invalid option name cell.
  
  1492      FILE ExcelTmp NOTAB LRECL=7000;
  ERROR 23-2: Invalid option name NOTAB.
  </code></pre>
  
  <p>If I write </p>
  
  <pre><code>FILENAME ExcelTmp DDE "EXCEL|[&amp;myInputTemplate.]&amp;mySheet.!R1C1:R1C1";
  </code></pre>
  
  <p>then the value is written to cell A1 in Excel.</p>
  
  <p>Is there some similar approach that works without invoking a macro? </p>
  
  <p>Thanks for your help!</p>
  
  <p>Christoph</p>