title: single quoting values using sql to create macro variable
body: <p>I am using a macro in SAS to loop over the data tables in a specific library. I put the metadata information in a data null step and make a comparison with a where statement and my macro variable.</p>
  
  <p>My SQL step looks like:</p>
  
  <pre><code>proc sql;
    select quote(trim(code)) into :procedures separated by ', ' from procedures;
  quit;
  </code></pre>
  
  <p>Some values of <code>code</code> contain values like "45.10" and "G0102", so cannot be coerced to numeric. The macro contains the line:</p>
  
  <pre><code>%macro filter_codes(indata, outdata);
    data &amp;outdata;
       set &amp;indata(where = (code in (&amp;procedures)));
    run;
  %mend;
  </code></pre>
  
  <p>but the decimal values create an issue when double-quoted using the "quote" function.</p>
  
  <p>Can I separate values with single quotes?</p>
  
  <p>EDIT: The issue was caused by the fact that the filter_codes macro was run within a call execute step (over a range of datasets) and double quotes resolved in macro variables inside of double quotes would end the call execute.</p>