<?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: Can i pass a complete where condition into a macro? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212151#M39210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no need to change the parameter DEFINITIONS from positional to named, you can call position parameters by name.&lt;/P&gt;&lt;P&gt;%eye(eye=varx='blue')&lt;/P&gt;&lt;P&gt;You can also add () which should not impact the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2015 22:45:33 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-06-23T22:45:33Z</dc:date>
    <item>
      <title>Re: Can i pass a complete where condition into a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212148#M39207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;reddyr1 wrote:&lt;/P&gt;&lt;P&gt;\begin{question}&lt;/P&gt;&lt;P&gt;%macro eye (eye,dat, id); &lt;/P&gt;&lt;P&gt;data adae ; &lt;/P&gt;&lt;P&gt;&amp;nbsp; set adamdata.adae; &lt;/P&gt;&lt;P&gt;&amp;nbsp; where &amp;amp;cond1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend eye; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The where condition(in red color) needs to be modified for each table.&lt;/P&gt;&lt;P&gt;Eg: where ethnicity="Hispanic"&lt;/P&gt;&lt;P&gt;\end{question}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your problem is that you want to pass a string with an equals sign in it&lt;/P&gt;&lt;P&gt;as a parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change from special character (=) to mnemonic (eq)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro eye (eye=,dat=, id=,cond1=); &lt;/P&gt;&lt;P&gt;%put &amp;amp;=cond1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* ... where &amp;amp;cond1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%eye(eye=,dat=,id=&lt;/P&gt;&lt;P&gt;,cond1=ethnicity eq 'Hispanic'); &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 15:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212148#M39207</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2015-06-23T15:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can i pass a complete where condition into a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212149#M39208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at using the %quote(....) macro function to enclose your data-passed WHERE logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; suggested SAS.COM reference search argument:&amp;nbsp; pass quotes macro invocation site:sas.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Barry&lt;/P&gt;&lt;P&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 20:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212149#M39208</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-06-23T20:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can i pass a complete where condition into a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212150#M39209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I asked a similar question a few weeks ago and it seems to work fine. I didn't have to mask anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://listserv.uga.edu/cgi-bin/wa?A2=ind1506a&amp;amp;L=SAS-L&amp;amp;P=91498" title="https://listserv.uga.edu/cgi-bin/wa?A2=ind1506a&amp;amp;L=SAS-L&amp;amp;P=91498"&gt;https://listserv.uga.edu/cgi-bin/wa?A2=ind1506a&amp;amp;L=SAS-L&amp;amp;P=91498&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 20:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212150#M39209</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-23T20:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can i pass a complete where condition into a macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212151#M39210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no need to change the parameter DEFINITIONS from positional to named, you can call position parameters by name.&lt;/P&gt;&lt;P&gt;%eye(eye=varx='blue')&lt;/P&gt;&lt;P&gt;You can also add () which should not impact the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 22:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Can-i-pass-a-complete-where-condition-into-a-macro/m-p/212151#M39210</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-06-23T22:45:33Z</dc:date>
    </item>
  </channel>
</rss>

