<?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 when to use double quotation marks in where statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/when-to-use-double-quotation-marks-in-where-statement/m-p/890088#M351690</link>
    <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question when do I have to use double quotation marks in where statement.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="horim_0-1692506539084.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/86844i21133E8126AABF4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="horim_0-1692506539084.png" alt="horim_0-1692506539084.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this problem, it says that I have to use single quotation marks.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="horim_1-1692506693453.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/86846iF127909939FD4CDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="horim_1-1692506693453.png" alt="horim_1-1692506693453.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;But in this problem, I can use double quotation marks.&lt;/P&gt;&lt;P&gt;What is the difference between both situations?&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
    <pubDate>Sun, 20 Aug 2023 05:05:29 GMT</pubDate>
    <dc:creator>horim</dc:creator>
    <dc:date>2023-08-20T05:05:29Z</dc:date>
    <item>
      <title>when to use double quotation marks in where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-to-use-double-quotation-marks-in-where-statement/m-p/890088#M351690</link>
      <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question when do I have to use double quotation marks in where statement.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="horim_0-1692506539084.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/86844i21133E8126AABF4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="horim_0-1692506539084.png" alt="horim_0-1692506539084.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this problem, it says that I have to use single quotation marks.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="horim_1-1692506693453.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/86846iF127909939FD4CDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="horim_1-1692506693453.png" alt="horim_1-1692506693453.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;But in this problem, I can use double quotation marks.&lt;/P&gt;&lt;P&gt;What is the difference between both situations?&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Sun, 20 Aug 2023 05:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-to-use-double-quotation-marks-in-where-statement/m-p/890088#M351690</guid>
      <dc:creator>horim</dc:creator>
      <dc:date>2023-08-20T05:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: when to use double quotation marks in where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-to-use-double-quotation-marks-in-where-statement/m-p/890090#M351692</link>
      <description>&lt;P&gt;SAS itself does not care if you use single quote characters (also called apostrophes)&amp;nbsp; or double quote characters on the outside to create string literals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it does not matter whether the string literals appear in a WHERE clause or any other place where a string literal can be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They suggested using single quotes in the first example because of the % characters in the sting.&amp;nbsp; The % and &amp;amp; characters are important to the MACRO PROCESSOR.&amp;nbsp; &amp;nbsp;The macro processor is a pre-processor that analyses the code and can be used to generate different SAS code based on the macro statements, macro variable references and macro call it sees in the text of the code.&amp;nbsp; The macro processor uses % as the trigger to look for a macro statement, or macro function call or a macro call.&amp;nbsp; It uses &amp;amp; as the trigger to start the evaluation of macro variable references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the macro processor will ignore string literals that are bounded by single quotes.&amp;nbsp; So when you use single quotes to enclose the string literal the macro processor will NOT see the string&amp;nbsp;&lt;FONT face="courier new,courier"&gt;%preserve&lt;/FONT&gt;&amp;nbsp;as an attempt to call a macro named preserve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second example does not have that problem because there is no way that the macro processor will interpret that % sign as the start of macro code since it is immediately followed by the quote. So in the second situation you can use either double quote characters,&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"YOSE%"&lt;/FONT&gt;, or single quote characters,&amp;nbsp;&lt;FONT face="courier new,courier"&gt;'YOSE%'&lt;/FONT&gt;, since there is no need to hide that string from the macro processor.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Aug 2023 15:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-to-use-double-quotation-marks-in-where-statement/m-p/890090#M351692</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-20T15:13:24Z</dc:date>
    </item>
  </channel>
</rss>

