<?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 problem interpreting %str syntax in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43170#M11264</link>
    <description>I saw this in a piece of code - %let custsegs = %str('E|002878','E|010208','00002878','E|X02964','E|002964','CS|E|002878','CS|E|010208','OPT_FA|00002878','CS|E|X02964','CS|E|002964');&lt;BR /&gt;
&lt;BR /&gt;
Can someone tell me what it means?&lt;BR /&gt;
&lt;BR /&gt;
Thanks, &lt;BR /&gt;
&lt;BR /&gt;
DanD</description>
    <pubDate>Wed, 20 Jan 2010 04:32:33 GMT</pubDate>
    <dc:creator>DanD</dc:creator>
    <dc:date>2010-01-20T04:32:33Z</dc:date>
    <item>
      <title>problem interpreting %str syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43170#M11264</link>
      <description>I saw this in a piece of code - %let custsegs = %str('E|002878','E|010208','00002878','E|X02964','E|002964','CS|E|002878','CS|E|010208','OPT_FA|00002878','CS|E|X02964','CS|E|002964');&lt;BR /&gt;
&lt;BR /&gt;
Can someone tell me what it means?&lt;BR /&gt;
&lt;BR /&gt;
Thanks, &lt;BR /&gt;
&lt;BR /&gt;
DanD</description>
      <pubDate>Wed, 20 Jan 2010 04:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43170#M11264</guid>
      <dc:creator>DanD</dc:creator>
      <dc:date>2010-01-20T04:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem interpreting %str syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43171#M11265</link>
      <description>Hi:&lt;BR /&gt;
  %STR is one of the SAS Macro Facility quoting functions. The relevant sections of the documentation are here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/tw3514-overvwqt.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/tw3514-overvwqt.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061325.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061325.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001072333.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001072333.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061345.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061345.htm&lt;/A&gt;&lt;BR /&gt;
               &lt;BR /&gt;
What will be informative, beyond the doc, is for you to find out WHERE in your code the macro variable &amp;amp;CUSTSEGS is used. For example, if you search for the macro variable in your code, you might find something like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  if WOMBAT in (&amp;amp;custsegs) then do; &lt;BR /&gt;
   ... more code ...&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                              &lt;BR /&gt;
which would tell you that the macro variable &amp;amp;CUSTSEGS is used in the IF statement to supply values for the IN operator that is testing the value of the dataset variable WOMBAT. If you then did a PROC FREQ:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc freq data=lib.dataset;&lt;BR /&gt;
  tables WOMBAT;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                          &lt;BR /&gt;
you would find out whether the values of the WOMBAT variable were correctly specified in the %LET statement inside the %STR function.&lt;BR /&gt;
             &lt;BR /&gt;
Generally speaking any of the Macro Quoting Functions, including %STR are used to mask or hide the normal syntactic meaning of certain special characters, as defined in the documentation. In this instance, I suspect that %STR was used in the %LET statement because someone felt that the single quotes or the pipe symbols needed to be "protected". &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 20 Jan 2010 05:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43171#M11265</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-01-20T05:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem interpreting %str syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43172#M11266</link>
      <description>The variable isn't used anywhere in the code that I have. I only have part of the code.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply.&lt;BR /&gt;
&lt;BR /&gt;
DanD</description>
      <pubDate>Wed, 20 Jan 2010 06:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-interpreting-str-syntax/m-p/43172#M11266</guid>
      <dc:creator>DanD</dc:creator>
      <dc:date>2010-01-20T06:43:21Z</dc:date>
    </item>
  </channel>
</rss>

