<?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: % inside string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/387039#M92756</link>
    <description>&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 14:51:07 GMT</pubDate>
    <dc:creator>FP12</dc:creator>
    <dc:date>2017-08-10T14:51:07Z</dc:date>
    <item>
      <title>% inside string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386557#M92602</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a file extraction macro based on this&lt;/P&gt;&lt;PRE&gt;data &amp;amp;output_table. (where=(filename like &amp;amp;filenames.));&lt;/PRE&gt;&lt;P&gt;In the definition of my macro I have the two variables:&lt;/P&gt;&lt;P&gt;-output_table&lt;/P&gt;&lt;P&gt;-filenames&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I call my macro in another part by defining output_table, and filenames like:&lt;/P&gt;&lt;PRE&gt;filenames = "File_52%Q&amp;amp;period_quarter.%.xls%"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where period_quarter is another macrovariable equal to 1 in my case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run it I have this warning, despite it is running well and give me good results:&lt;/P&gt;&lt;PRE&gt;WARNING: Apparent invocation of macro Q1 not resolved.&lt;/PRE&gt;&lt;P&gt;Surely because it is using the % character as a macro calling.&lt;/P&gt;&lt;P&gt;What I don't understand is that for the second % and third %, I don't have the warning.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you know what happens here?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 11:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386557#M92602</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-09T11:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: % inside string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386567#M92607</link>
      <description>&lt;P&gt;The percent at the end of the string has nothing following, so it can't be a macro call. The secoind percent is follwed immediately by a dot (invalid in SAS names), so it also can't be a macro call. But the first percent is followed by something that &lt;EM&gt;could&lt;/EM&gt; be a macro name, and that causes your problem.&lt;/P&gt;
&lt;P&gt;Restructure your statement to mask the macro triggers:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filenames = 'File_52%Q'!!"&amp;amp;period_quarter"!!'%.xls%';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2017 11:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386567#M92607</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-09T11:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: % inside string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386568#M92608</link>
      <description>&lt;P&gt;BTW one of the reasons why such special characters have no place in data file names, along with blanks.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 11:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386568#M92608</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-09T11:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: % inside string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386573#M92611</link>
      <description>&lt;P&gt;Post what you are trying to do. &amp;nbsp;Supply test data in the form of a datastep. &amp;nbsp;Its highly likely there are better methods than what you are doing here. &amp;nbsp;It looks like your using % as a wildcard for instance, you would be better off fixing it down to something more like scan(file,2,".") in ("XLS","XLSX"); &amp;nbsp;Although do note you may have to handle these things differntly. &amp;nbsp;Further info is needed for more help.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 11:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/386573#M92611</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-09T11:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: % inside string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/387039#M92756</link>
      <description>&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 14:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inside-string/m-p/387039#M92756</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-10T14:51:07Z</dc:date>
    </item>
  </channel>
</rss>

