<?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: Need Help to search value which has quote in it in sas dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/568081#M11618</link>
    <description>&lt;P&gt;Another approach that you should be aware of is doubling the quote character where needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
run;

data abc;
    set abcd;
    where col1='ABC &lt;FONT color="#0000ff"&gt;''&lt;/FONT&gt;DEF';
run;&lt;/PRE&gt;
&lt;P&gt;The quote in blue is two single quotes.&lt;/P&gt;
&lt;P&gt;You will want to know this because if you manage to acquire a string with both single and double quote marks then you would still have the issue. Consider searching for something like 5' 8"&amp;nbsp;. Then either '5' 8"' or "5' 8"" will have a problem. The two quotes together are the solution in that case:&lt;/P&gt;
&lt;PRE&gt;data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
col1="5'12""";output;
run;

data abc;
    set abcd;
    where col1="5'12""";;
run;&lt;/PRE&gt;
&lt;P&gt;Look at the abcd set to verify that there is only one double quote in the last value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 21:16:32 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-06-21T21:16:32Z</dc:date>
    <item>
      <title>Need Help to search value which has quote in it in sas dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/567829#M11577</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable in which we have value with Single Quote in it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: ABC 'DEF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I find for this like within a dataset,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;set abcd;&lt;/P&gt;&lt;P&gt;where col1 = 'ABC 'DEF';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;It is giving error as ' Where clause operator requires Compatible variables' And here &lt;STRONG&gt;Col1&lt;/STRONG&gt; is a Character Variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest your inputs.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 05:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/567829#M11577</guid>
      <dc:creator>Hari2</dc:creator>
      <dc:date>2019-06-21T05:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to search value which has quote in it in sas dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/567833#M11579</link>
      <description>&lt;P&gt;Use double quotes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
run;

data abc;
    set abcd;
    where col1="ABC 'DEF";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 05:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/567833#M11579</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-21T05:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help to search value which has quote in it in sas dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/568081#M11618</link>
      <description>&lt;P&gt;Another approach that you should be aware of is doubling the quote character where needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
run;

data abc;
    set abcd;
    where col1='ABC &lt;FONT color="#0000ff"&gt;''&lt;/FONT&gt;DEF';
run;&lt;/PRE&gt;
&lt;P&gt;The quote in blue is two single quotes.&lt;/P&gt;
&lt;P&gt;You will want to know this because if you manage to acquire a string with both single and double quote marks then you would still have the issue. Consider searching for something like 5' 8"&amp;nbsp;. Then either '5' 8"' or "5' 8"" will have a problem. The two quotes together are the solution in that case:&lt;/P&gt;
&lt;PRE&gt;data abcd;
col1="ABC 'DEF";output;
col1="ABCABC";output;
col1="5'12""";output;
run;

data abc;
    set abcd;
    where col1="5'12""";;
run;&lt;/PRE&gt;
&lt;P&gt;Look at the abcd set to verify that there is only one double quote in the last value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 21:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-to-search-value-which-has-quote-in-it-in-sas-dataset/m-p/568081#M11618</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-21T21:16:32Z</dc:date>
    </item>
  </channel>
</rss>

