<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Where In clause with Apostrophes in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194627#M4455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answering my questions about crazy quotes.&amp;nbsp; I’ve been doing a lot of work with quotes lately and it’s a learning curve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2015 01:16:08 GMT</pubDate>
    <dc:creator>DavidPhillips2</dc:creator>
    <dc:date>2015-05-28T01:16:08Z</dc:date>
    <item>
      <title>Where In clause with Apostrophes</title>
      <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194625#M4453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; background: white;"&gt;I am trying to run a where in proc sql clause where a character string is fed into the list.&amp;nbsp; When I feed the string in it errors out.&amp;nbsp; Am I using the right structure?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black; background: white;"&gt; sumlev = 'AX', 'AH';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black; background: white;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black; background: white;"&gt;where term =&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: purple; background: white;"&gt;'Fall'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black; background: white;"&gt; and college in (&amp;amp;sumlev);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: black; background: white;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 23:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194625#M4453</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-05-27T23:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Where In clause with Apostrophes</title>
      <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194626#M4454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is fine, once you have valid SQL, anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, given your other post about adding the apostrophes, which used macro quoting, you need to %unquote() the macro variable for it to work correctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a=%str(%');&lt;/P&gt;&lt;P&gt;%let sex=&amp;amp;a.M&amp;amp;a.,'F';&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from sashelp.class where sex in (%unquote(&amp;amp;sex.));&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 00:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194626#M4454</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2015-05-28T00:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Where In clause with Apostrophes</title>
      <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194627#M4455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answering my questions about crazy quotes.&amp;nbsp; I’ve been doing a lot of work with quotes lately and it’s a learning curve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 01:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194627#M4455</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-05-28T01:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Where In clause with Apostrophes</title>
      <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194628#M4456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not need to use quote character . For your situation , use symget() would be better;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: blue; background-position: initial;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: black; background-position: initial;"&gt; sumlev = AX AH ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: black; background-position: initial;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: black; background-position: initial;"&gt;where term =&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: purple; background-position: initial;"&gt;'Fall'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: black; background-position: initial;"&gt; and &lt;STRONG&gt;symget&lt;/STRONG&gt;(&lt;SPAN style="color: #000000; font-family: Arial, sans-serif; background-color: #ffffff;"&gt;sumlev&lt;/SPAN&gt;)&amp;nbsp; contains strip(college) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Arial, sans-serif; color: black; background-position: initial;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 14:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194628#M4456</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-28T14:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Where In clause with Apostrophes</title>
      <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194629#M4457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One minor correction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symget('sumlev')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes, this will work and does not require the quoting or delimiting of the list and is viable with the example data (although may not be with your actual data, depending...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 14:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194629#M4457</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2015-05-28T14:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Where In clause with Apostrophes</title>
      <link>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194630#M4458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Opps. Did you see Arthur.T before ?&amp;nbsp; He didn't appear here for a very long time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 15:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-In-clause-with-Apostrophes/m-p/194630#M4458</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-28T15:01:35Z</dc:date>
    </item>
  </channel>
</rss>

