title: Does the prompt manager escape characters?
body: <p>I am working on a SAS program and I created a prompt which should allow a user to enter a comma separated list of values. The values are then used in a <code>WHERE IN</code> clause. The problem is that the prompt manager appears to be escaping the quotes, somehow, resulting in weird error messages.</p>
  
  <p>To show the error, I've created this sample data set:</p>
  
  <pre><code>DATA Work.Birds;
  
      LENGTH  Category    $   20
              CommonName  $   27
              ;
  
      INPUT   Category    $   1-20
              CommonName  $   22-48
              ;
  
  DATALINES;
  Ostriches            Common Ostrich
  Ostriches            Greater Rhea
  Cassowaries and Emus Southern Cassowary
  Cassowaries and Emus Dwarf Cassowary
  Kiwis                Brown Kiwi
  Kiwis                Little Spotted Kiwi
  Waterfowls           Horned Screamer
  Waterfowls           Magpie-goose
  Penguins             Emperor Penguin
  Penguins             King Penguin
  RUN;
  </code></pre>
  
  <p>Now, using a <code>%LET</code> statement, I can write a more-or-less-dynamic query for particular birds:</p>
  
  <pre><code>%LET BirdCategories = 'Kiwis', 'Penguins';
  
  %PUT "&amp;BirdCategories.";
  
  PROC SQL NOPRINT;
      CREATE TABLE Work.SelectedBirds AS
      SELECT      *
      FROM        Work.Birds
      WHERE       Category IN ( &amp;BirdCategories. )
      ;
  QUIT;
  </code></pre>
  
  <p>This code prints the following to the log:</p>
  
  <pre><code>"'Kiwis', 'Penguins'"
  </code></pre>
  
  <p>It also creates a dataset with four records.</p>
  
  <p>Now I try to create a prompt using the prompt manager with the instructions found in the <a href="http://support.sas.com/resources/papers/proceedings10/041-2010.pdf" rel="nofollow noreferrer">official documentation</a>. The goal is to replace the single <code>%LET</code> line with a prompt <em>without adding any additional code</em>.</p>
  
  <p>So I created a prompt named BirdCategories and set the Number of Values to "Single Value":</p>
  
  <p><img src="https://i.stack.imgur.com/qUYTH.png" alt="Screen-shot of first tab"></p>
  
  <p><img src="https://i.stack.imgur.com/dmLUL.png" alt="Screen-shot of second tab"></p>
  
  <p>I then run the program again (this time commenting out the <code>%LET</code> statement):</p>
  
  <p><img src="https://i.stack.imgur.com/6ilft.png" alt="Sceen-shot of prompt"></p>
  
  <p>The log outputs the following for BirdCategories:</p>
  
  <pre><code>"'Kiwis', 'Waterfowls'"
  </code></pre>
  
  <p>But I get an error in my SQL statement:</p>
  
  <pre><code>43             PROC SQL NOPRINT;
  44                 CREATE TABLE Work.SelectedBirds AS
  45                 SELECT      *
  46                 FROM        Work.Birds
  47                 WHERE       Category IN ( &amp;BirdCategories. )
  
             _
             22
             200
  ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, 
                a missing value, (, -, SELECT.  
  
  ERROR 200-322: The symbol is not recognized and will be ignored.
  
  48                 ;
  NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
  49             QUIT;
  </code></pre>
  
  <p>(I get the same error whether I use <code>PROC SQL</code> or a <code>DATA</code> step with a <code>WHERE IN</code> clause.)</p>
  
  <p>Then I tried inputting <code>Kiwis", "Waterfowls</code> with the following code:</p>
  
  <pre><code>PROC SQL NOPRINT;
      CREATE TABLE Work.SelectedBirds AS
      SELECT      "&amp;BirdCategories."
      FROM        Work.Birds
      ;
  QUIT;
  </code></pre>
  
  <p>which should create two columns, but instead I get this:</p>
  
  <p><img src="https://i.stack.imgur.com/kHBQA.png" alt="One column with embedded quotes rather than two columns"></p>
  
  <p>If I set the macro variable with a SYMPUT, like so:</p>
  
  <pre><code>DATA _NULL_;    
      CALL SYMPUT( 'BirdCategories', 'Kiwis", "Penguins' );
  RUN;
  </code></pre>
  
  <p>I get two columns as expected:</p>
  
  <p><img src="https://i.stack.imgur.com/pg2mB.png" alt="two columns"></p>
  
  <p>I can't see it, but the prompt manager must be escaping my quote characters somehow. Any clue what's going on? I've tried my google-fu to no avail.</p>