<?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: Single quotes in a list of strings in a macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811907#M320297</link>
    <description>&lt;P&gt;What happens if you use double quotes in &amp;amp;EXCLUDE (except for the one single quote inside of the first value)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, remove the &amp;amp; from in front of GA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that still doesn't work, show us the ENTIRE log for your PROC SQL, not selected parts&lt;/P&gt;</description>
    <pubDate>Fri, 06 May 2022 16:54:26 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-05-06T16:54:26Z</dc:date>
    <item>
      <title>Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811901#M320296</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;Hi All&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;I have a list of names that i am trying to add in a macro variable as follows-&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;%let EXCLUDE =&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;('Randomgroup Fl's dummy' ,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;'Randomgroup &amp;amp;GA' ,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;'Randomgroup KY' ,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;'Randomgroup NJ' ,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;'Randomgroup NM') ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Later on in want to use it in my program as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;proc sql;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;create table exclusion_data as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;select distinct * from Base_data&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;where group_name&amp;nbsp; in &amp;amp;exclude. ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;Now since one of the name in the list (&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Randomgroup Fl's dummy&lt;/FONT&gt;) has a single quote my program errors out with below error-&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space&lt;BR /&gt;between a quoted string and the succeeding identifier is recommended.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;Could you please help with how do i deal with it.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;P.S.- I tried to enclose my vales with a double quote while inserting in the macro variable still got the same error.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif" size="2"&gt;Bhawna&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 16:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811901#M320296</guid>
      <dc:creator>ratnaparakhee</dc:creator>
      <dc:date>2022-05-06T16:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811907#M320297</link>
      <description>&lt;P&gt;What happens if you use double quotes in &amp;amp;EXCLUDE (except for the one single quote inside of the first value)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, remove the &amp;amp; from in front of GA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that still doesn't work, show us the ENTIRE log for your PROC SQL, not selected parts&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 16:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811907#M320297</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-06T16:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811918#M320301</link>
      <description>&lt;P&gt;That usually is a NOTE not an ERROR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, macro variables will not resolve with single quotes and you cannot have a single quote in a text that's embedded with single quotes. Those are errors.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fix it as indicated in the message:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Inserting white space
between a quoted string and the succeeding identifier is recommended.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Add spaces:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let EXCLUDE =

( "Randomgroup Fl's dummy" ,
"Randomgroup &amp;amp;GA" ,
'Randomgroup KY' ,
'Randomgroup NJ' ,
'Randomgroup NM' ) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 17:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811918#M320301</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-05-06T17:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811936#M320313</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409870"&gt;@ratnaparakhee&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can just duplicate the inner single quote:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4"&gt;'Randomgroup Fl'&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;&lt;/FONT&gt;s dummy'&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 May 2022 20:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811936#M320313</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-05-06T20:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811949#M320322</link>
      <description>&lt;P&gt;Handle it the exact same way you would if you were not using macro variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let EXCLUDE =
('Randomgroup Fl''s dummy' 
,'Randomgroup &amp;amp;GA' 
,'Randomgroup KY' 
,'Randomgroup NJ' 
,'Randomgroup NM'
) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS Don't hide the continuation characters are the ends of the lines.&amp;nbsp; Place them at the front where humans can scan for them quickly.&lt;/P&gt;</description>
      <pubDate>Sat, 07 May 2022 01:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/811949#M320322</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-07T01:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812300#M320489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the solution. This was the easiest way to get rid of my error and my list and macro variable are working fine.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 06:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812300#M320489</guid>
      <dc:creator>ratnaparakhee</dc:creator>
      <dc:date>2022-05-10T06:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812301#M320490</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; for the solution.&lt;/P&gt;&lt;P&gt;I was able to get rid of my error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bhawna&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 06:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812301#M320490</guid>
      <dc:creator>ratnaparakhee</dc:creator>
      <dc:date>2022-05-10T06:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812302#M320491</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to add that extra space between the identifier and quoted string but it still didn't work out.&lt;/P&gt;&lt;P&gt;I was however able to get rid of the error by adding an extra single quote as&lt;/P&gt;&lt;P&gt;'Random group FL' ' s dummy' ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Bhawna&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 06:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812302#M320491</guid>
      <dc:creator>ratnaparakhee</dc:creator>
      <dc:date>2022-05-10T06:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812303#M320492</link>
      <description>Thanks for looking into my problem. The double quotes was still giving the same error.&lt;BR /&gt;I was however able to solve my problem by adding an extra single quote.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Bhawna</description>
      <pubDate>Tue, 10 May 2022 06:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812303#M320492</guid>
      <dc:creator>ratnaparakhee</dc:creator>
      <dc:date>2022-05-10T06:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Single quotes in a list of strings in a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812424#M320554</link>
      <description>&lt;P&gt;Second sentence in the answer.....&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 15:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-quotes-in-a-list-of-strings-in-a-macro-variable/m-p/812424#M320554</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-05-10T15:17:30Z</dc:date>
    </item>
  </channel>
</rss>

