<?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: macro does not read next text in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591091#M169272</link>
    <description>It looks like you have been fiddling around with the problem.&lt;BR /&gt;&lt;BR /&gt;That might explain the results.&lt;BR /&gt;&lt;BR /&gt;The calls to the macro should not use quotes:&lt;BR /&gt;&lt;BR /&gt;%fix (2019)&lt;BR /&gt;%fix (2018)&lt;BR /&gt;%fix (2017)</description>
    <pubDate>Tue, 24 Sep 2019 07:12:30 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-09-24T07:12:30Z</dc:date>
    <item>
      <title>macro does not read next text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591082#M169271</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my script below:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let list=;&lt;/P&gt;&lt;P&gt;%macro fix(suffix);&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select name into :vars separated by ' '&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where upcase(libname)=upcase('work')&lt;BR /&gt;and upcase(memname)=upcase('RN_LIST')&lt;BR /&gt;and index(name,upcase("&amp;amp;suffix")) ge 1;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%let list=&amp;amp;list &amp;amp;vars;&lt;/P&gt;&lt;P&gt;%put &amp;amp;list;&lt;BR /&gt;&lt;BR /&gt;%mend fix;&lt;/P&gt;&lt;P&gt;%fix('2019');&lt;BR /&gt;%fix('2018');&lt;BR /&gt;%fix('2017');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to take variables from the past 3 years.&lt;/P&gt;&lt;P&gt;however it keeps duplicating '2019'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32698iE756DF3B919983C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could someone please help to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 06:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591082#M169271</guid>
      <dc:creator>ikeum</dc:creator>
      <dc:date>2019-09-24T06:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: macro does not read next text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591091#M169272</link>
      <description>It looks like you have been fiddling around with the problem.&lt;BR /&gt;&lt;BR /&gt;That might explain the results.&lt;BR /&gt;&lt;BR /&gt;The calls to the macro should not use quotes:&lt;BR /&gt;&lt;BR /&gt;%fix (2019)&lt;BR /&gt;%fix (2018)&lt;BR /&gt;%fix (2017)</description>
      <pubDate>Tue, 24 Sep 2019 07:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591091#M169272</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-09-24T07:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: macro does not read next text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591098#M169276</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291987"&gt;@ikeum&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing to remember, which may make your macroprogramming easier, macro code operate on texts and treats _everything_ as text so no quotes are needed. In your case when you are passing &amp;gt;&amp;gt;'2019'&amp;lt;&amp;lt; SAS uses all 6 characters: apostrophe, two, zero, one, nine, and apostrophe as macrovariable's value. Do it as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;pointed out, &amp;gt;&amp;gt;2019&amp;lt;&amp;lt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 07:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591098#M169276</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-09-24T07:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: macro does not read next text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591130#M169298</link>
      <description>&lt;P&gt;Just to add to what the others already found: you do not need upcase() on libname and memname. These columns are always uppercase in the dictionary tables. But you should use upcase on name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and index(upcase(name),upcase("&amp;amp;suffix")) ge 1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as column names in SAS can be partially or completely lowercase.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 11:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-does-not-read-next-text/m-p/591130#M169298</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-24T11:11:57Z</dc:date>
    </item>
  </channel>
</rss>

