<?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: Use a string as a rule for where in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557965#M155628</link>
    <description>&lt;P&gt;Yes it is possible. Did you try to run your code? What went wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I see it you are missing a semicolon&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro teste (rule);
   Data example;
   set source;
   where &amp;amp;rule.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 May 2019 20:43:18 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-05-10T20:43:18Z</dc:date>
    <item>
      <title>Use a string as a rule for where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557963#M155627</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro function, as in the example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro teste (rule);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Data example;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;set source;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;where &amp;amp;rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend teste;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%teste("COLUMN = 23");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I want to use the string&amp;nbsp;"COLUMN = 23" as a text for the WHERE rule. Is it possible? Or is there another way to do it in SAS (i.e. so I can change the rule in a macro variable, for example).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanls&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 20:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557963#M155627</guid>
      <dc:creator>rodrigobarg</dc:creator>
      <dc:date>2019-05-10T20:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use a string as a rule for where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557965#M155628</link>
      <description>&lt;P&gt;Yes it is possible. Did you try to run your code? What went wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I see it you are missing a semicolon&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro teste (rule);
   Data example;
   set source;
   where &amp;amp;rule.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 20:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557965#M155628</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-10T20:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use a string as a rule for where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557969#M155630</link>
      <description>&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro teste (rule);

   Data example;
   set source;
   where &amp;amp;rule.
   run;

%mend teste;

%teste(%nrstr(column=23))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 20:45:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557969#M155630</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-05-10T20:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use a string as a rule for where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557970#M155631</link>
      <description>&lt;P&gt;Sorry, I added the semicollon, but I still get a syntax error...&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 20:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557970#M155631</guid>
      <dc:creator>rodrigobarg</dc:creator>
      <dc:date>2019-05-10T20:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Use a string as a rule for where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557974#M155634</link>
      <description>&lt;P&gt;This works! Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 20:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-string-as-a-rule-for-where/m-p/557974#M155634</guid>
      <dc:creator>rodrigobarg</dc:creator>
      <dc:date>2019-05-10T20:50:07Z</dc:date>
    </item>
  </channel>
</rss>

