<?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: Problem with a macro variable: probably quotation related in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136453#M36795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What wouldn't accept them?&amp;nbsp; The %LET statement doesn't care.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Sep 2014 23:09:21 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-09-11T23:09:21Z</dc:date>
    <item>
      <title>Problem with a macro variable: probably quotation related</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136449#M36791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to pass the contents of an entire&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN list. Each of the elements in the list have to be quoted. What I have is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%LET INECCGRP = "('1-1' '1-3' '1-5' '1-7' '1-9' '1-11' '1-13' '1-15')";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As shown below, the macro variable INECCGRP resolves to:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "('1-1' '1-3' '1-5' '1-7' '1-9' '1-11' '1-13' '1-15')"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;including the leading and trailing double-quotation marks which make that invalid at execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure this is some combination of the xQUOTE functions but I'm not hitting the right ones in playing trial and error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The users of this program will edit the %LET statements but not the underlying macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error received:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;44021 /* ----------------------------------------------------------------------------------------- ------------------- */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44022 /* Below: list the Parity Groups to be used for the Pool's P-Vols. Use single quote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44022! marks with a hyphen */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44023 /* Example: if ECC_Group in ('1-1' '1-3' '1-5' '1'7');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44023! */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44024 /*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44024! -----------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44024! ------------------- */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44025&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44026 DQINECC1 = length((%STR(&amp;amp;INECCGRP)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INECCGRP resolves to "('1-1' '1-3' '1-5' '1-7' 1-9' '1-11' '1-13'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'1-15')"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44027 DQINECC2 = substr(&amp;amp;INECCGRP,2,(DQINECC1-1)); put @ 001 "DQINECC2=" DQINECC2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INECCGRP resolves to "('1-1' '1-3' '1-5' '1-7' 1-9' '1-11' '1-13'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'1-15')"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44028&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44029 if ECC_Group in DQINECC2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: The right-hand operand must be an array name or a constant value list. The specified&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name DQINECC2, is not an array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44030&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44031&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44032&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44033 /*('1-1' '1-2' '1-3' '1-4' '1-5' '1-6' '1-7' '1-8' '1-9' '1-10' '1-11' '1-12' '1-13'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44033! '1-14' '1-15') ; */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;44034&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 10:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136449#M36791</guid>
      <dc:creator>lloydc</dc:creator>
      <dc:date>2014-09-09T10:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a macro variable: probably quotation related</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136450#M36792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your actual error message is from the miss use of the IN operator in the SAS and not from the macro variable.&lt;/P&gt;&lt;P&gt;You have written: if ECC_GROUP in DQINECC2&lt;/P&gt;&lt;P&gt;You cannot use the IN operator with a single character variable.&amp;nbsp; You need to use in in the form&lt;/P&gt;&lt;P&gt;if ECC_GROUP in &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;('1-1' '1-3' '1-5' '1-7' '1-9' '1-11' '1-13' '1-15')&lt;/SPAN&gt; ... &lt;/P&gt;&lt;P&gt;You could use the macro variable but you would need to get rid of the unneeded extra double quote characters around the outside.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%LET INECCGRP = ('1-1' '1-3' '1-5' '1-7' '1-9' '1-11' '1-13' '1-15') ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; if ECC_Group in &amp;amp;ineccgrp ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why did you include the double quotes in the first place?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 11:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136450#M36792</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-09T11:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a macro variable: probably quotation related</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136451#M36793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It wouldn't accept the value including the parenthesis without the double quotes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 22:05:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136451#M36793</guid>
      <dc:creator>lloydc</dc:creator>
      <dc:date>2014-09-11T22:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a macro variable: probably quotation related</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136452#M36794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A programming style choice. I would tend not to disguise the purpose of the macro variable as a combination of parentheses and a value list.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;%let INECCGRP = '1-1' '1-3' '1-5' '1-7' '1-9' '1-11' '1-13' '1-15';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;and in the datastep&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;if ECC_group in (&amp;amp;ineccgrp);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;then when I read the code much later I will realize the &amp;amp;inccgrp relates to a list of values. and that's all (hopefully).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 22:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136452#M36794</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-11T22:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a macro variable: probably quotation related</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136453#M36795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What wouldn't accept them?&amp;nbsp; The %LET statement doesn't care.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 23:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-a-macro-variable-probably-quotation-related/m-p/136453#M36795</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-11T23:09:21Z</dc:date>
    </item>
  </channel>
</rss>

