<?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 and where in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111427#M23076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to make it clearer:&amp;nbsp; is it one, two, or "multiple values".&amp;nbsp; If two, just use two parameters as above.&amp;nbsp; If it's "multiple values", where the number could vary, review the doc for parmbuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206961.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206961.htm"&gt;SAS(R) 9.2 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Feb 2013 10:24:42 GMT</pubDate>
    <dc:creator>ScottBass</dc:creator>
    <dc:date>2013-02-17T10:24:42Z</dc:date>
    <item>
      <title>Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111420#M23069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro test(var1=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sql--statements;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where id in (&amp;amp;var1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test(var1=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user can pass one or more var1. How to pass the values into where clause with quotes around them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 20:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111420#M23069</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-02-15T20:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111421#M23070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;;puI usually start with&lt;/P&gt;&lt;P&gt;%test (var1=%str('a' 'b'));&lt;/P&gt;&lt;P&gt;and see if that works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 23:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111421#M23070</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-02-15T23:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111422#M23071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you need macro quoting (the %STR function) in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%test(var1='a' 'b')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I would suggest you change the name of the parameter.&amp;nbsp; I think var1= suggests that the user should pass in the name of a variable.&amp;nbsp; In this case, the user is passing in a value, not a variable.&amp;nbsp; So you might want to call it value1= or IDlist= or something like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;-Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2013 02:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111422#M23071</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2013-02-16T02:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111423#M23072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are a few options.&lt;/P&gt;&lt;P&gt;1) Put the () needed for the IN operator into the value passed into the macro variable. This will allow you to use commas without confusing SAS.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro test1(idlist=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; where name in &amp;amp;idlist ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend test1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%test1(idlist=('Alfred','Alice') )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) It the values cannot contain spaces then just pass the variables as space delimited instead of comma delimited.&amp;nbsp; Add the commas in the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro test2(idlist=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let idlist=%sysfunc(tranwrd(%sysfunc(compbl(&amp;amp;idlist)),%str( ),%str(,))) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; where name in (&amp;amp;idlist) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%test2(idlist='Alfred'&amp;nbsp; 'Alice' )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;3) Same as (2) but also add the quotes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro test3(idlist=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let idlist=%sysfunc(tranwrd(%str(%')%sysfunc(compbl(&amp;amp;idlist))%str(%'),%str( ),',')) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; where name in (&amp;amp;idlist) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend test3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%test3(idlist=Alfred&amp;nbsp; Alice);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2013 04:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111423#M23072</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-16T04:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111424#M23073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom.The whole idea is user will provide the input from front end.There is a chance s/he may select one value for var1 or multiple values.And also I need to make sure the code works if he is passing another variable var2. So the situation could be he may choose to pass var1 and var2 or either of these two.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Feb 2013 02:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111424#M23073</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-02-17T02:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111425#M23074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then just amend Tom's code accordingly. Below a sample how this could look like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options mprint;&lt;BR /&gt;%macro test2(var1=,var2=);&lt;BR /&gt;&amp;nbsp; %if &amp;amp;var1 ne %then %let var1=%sysfunc(tranwrd(%sysfunc(compbl(&amp;amp;var1)),%str( ),%str(,))) ;&lt;BR /&gt;&amp;nbsp; %if &amp;amp;var2 ne %then %let var2=%sysfunc(tranwrd(%sysfunc(compbl(&amp;amp;var2)),%str( ),%str(,))) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if (&amp;amp;var1&amp;amp;var2) ne %then %str(where); &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;var1 ne&amp;nbsp; %then %str(name in (&amp;amp;var1)) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;var1 ne and &amp;amp;var2 ne %then %str(and); &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;var2 ne&amp;nbsp; %then %str(sex in (&amp;amp;var2)) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %str(;)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put (_all_) (=);&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;%mend test2;&lt;/P&gt;&lt;P&gt;%test2(var1='Alfred'&amp;nbsp; 'Alice' )&lt;BR /&gt;%test2(var1='Alfred'&amp;nbsp; 'Alice',var2='M' )&lt;BR /&gt;%test2(var2='M' )&lt;BR /&gt;%test2();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Feb 2013 02:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111425#M23074</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-02-17T02:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111426#M23075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm a big fan of Richard DeVenezia's %seplist macro (and pretty much all things DeVenezia...really smart dude).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The %seplist macro makes it really easy to move between data step and SQL syntax.&amp;nbsp; Just keep your parameters as space delimited, and use %seplist when you need comma separated values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See &lt;A href="http://www.devenezia.com/downloads/sas/macros/index.php" title="http://www.devenezia.com/downloads/sas/macros/index.php"&gt;SAS Macros - by Richard A. DeVenezia &lt;/A&gt;and &lt;A href="http://www.devenezia.com/downloads/sas/macros/index.php?m=seplist" title="http://www.devenezia.com/downloads/sas/macros/index.php?m=seplist"&gt;SAS Macros - by Richard A. DeVenezia - seplist.sas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the syntax would be (untested):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%macro test(var1=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sql--statements;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; where id in (%seplist(&amp;amp;var1,nest=QQ));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%mend;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%test(var1=A B C);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Download the macro, read the header, and test with %put %seplist(...).&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Feb 2013 08:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111426#M23075</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-02-17T08:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111427#M23076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to make it clearer:&amp;nbsp; is it one, two, or "multiple values".&amp;nbsp; If two, just use two parameters as above.&amp;nbsp; If it's "multiple values", where the number could vary, review the doc for parmbuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206961.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206961.htm"&gt;SAS(R) 9.2 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Feb 2013 10:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111427#M23076</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-02-17T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111428#M23077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro test(var1=,var2=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sql--statements;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where id in (&amp;amp;var1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where ssn in (&amp;amp;var2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test(var1=, var2=);&lt;/P&gt;&lt;P&gt;The user can pass one parameter var1 with one or more values OR he can pass multiple parameters var1 var2 .. with one or more values to var1 /var2.&lt;/P&gt;&lt;P&gt;So if only var1 is passed then the where condition must work only for those values of var1.&lt;/P&gt;&lt;P&gt;if var2 is passed where condition must pass for var2 values.&lt;/P&gt;&lt;P&gt;For example..if var1 is id then where id in (....). the other where condition must not be executed.&lt;/P&gt;&lt;P&gt;if var2 is ssn, only&amp;nbsp; where ssn in (....), must be executed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 14:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111428#M23077</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-02-19T14:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111429#M23078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, you say:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The user can pass one parameter var1 with one or more values, OR&lt;/LI&gt;&lt;LI&gt;He can pass &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;multiple&lt;/STRONG&gt;&lt;/SPAN&gt; parameters var1 var2 &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/SPAN&gt; with one or more values to var1 / var2.&amp;nbsp; (emphasis added, what's with the ellipsis?)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for being dense, but let me reword that 2nd statement to make sure I've got it right:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He can pass &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;two&lt;/STRONG&gt;&lt;/SPAN&gt; parameters var1 var2, with one or more values to var1 &lt;SPAN style="text-decoration: underline;"&gt;and&lt;/SPAN&gt; var2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You then say the var2 parameter has precedence over the var1 parameter, if defined (non-blank).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming this is correct, does this work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go here:&amp;nbsp; &lt;A href="http://www.devenezia.com/downloads/sas/macros/index.php?m=seplist" title="http://www.devenezia.com/downloads/sas/macros/index.php?m=seplist"&gt;SAS Macros - by Richard A. DeVenezia - seplist.sas&lt;/A&gt;, copy %seplist, and compile the macro.&amp;nbsp; Then submit the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: #A0C0FF;"&gt;%macro&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; sasphile(var1=, var2=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; %&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* var1 and var2 should be space separated lists ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%local&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; filter;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%superq&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;(var2) ne ) &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%then&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%do&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; filter = age in (%seplist(&amp;amp;var2));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%end&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%else&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%superq&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;(var1) ne ) &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%then&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%do&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; var1=&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%upcase&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;(&amp;amp;var1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; filter = upcase(name) in (%seplist(&amp;amp;var1,nest=qq));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; filter = &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%unquote&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;(&amp;amp;filter);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%end&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table test as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from sashelp.class&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%superq&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;(filter) ne ) &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%then&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%do&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where &amp;amp;filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%end&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; proc print;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: #A0C0FF;"&gt;%mend&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;options&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;mprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;sasphile&lt;/EM&gt;&lt;/STRONG&gt;(var1=alfred henry joyce robert)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;sasphile&lt;/EM&gt;&lt;/STRONG&gt;(var1=alfred henry joyce robert, var2=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;12&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;14&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further comments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; %seplist returns a macro quoted string (see the qscan function in the macro).&amp;nbsp; You can either change the bottom of the macro from &amp;amp;emit to %unquote(&amp;amp;emit), or else unquote the results in your calling code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(If you ever write a macro, view the mprint results in the log, go "I swear this code is correct", and start pulling your hair out, check your macro quoting ;-).&amp;nbsp; To see what I mean, comment out or delete the line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt; filter = &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%unquote&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt;(&amp;amp;filter);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and resubmit with MPRINT active.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; These lines could be combined:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt; var1=&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%upcase&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt;(&amp;amp;var1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt; filter = upcase(name) in (%seplist(&amp;amp;var1,nest=qq));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt; filter = &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%unquote&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt;(&amp;amp;filter);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, the %upcase function does implicit macro unquoting, so this would work, although it's perhaps less clear:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; filter = upcase(name) in (&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;%upcase&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;(%seplist(&amp;amp;var1,nest=qq)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; The %superq function calls are probably unnecessary, but is defensive coding.&amp;nbsp; Say you DID have the names AND and OR in your dataset (a contrived example I know):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; sashelp.class end=eof;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; eof &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"AND"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"OR"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;sasphile&lt;/EM&gt;&lt;/STRONG&gt;(var1=alfred henry joyce robert and or)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The current macro works, even if your where clause contains reserved macro operators.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now remove the %superq function calls, i.e. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'SAS Monospace';"&gt;%if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt; (&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt;var2 ne )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and resubmit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 00:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111429#M23078</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-02-20T00:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111430#M23079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will try this and let you know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 21:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111430#M23079</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-02-20T21:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111431#M23080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying to find a better way to pass an IN() list in a data step than typing out the quote comma list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott- I found the %seplist macro under another posting, and was caught in the hair-pulling stage as I have not encountered macro quoting before.&amp;nbsp; Thanks for posting the unquote() solution.&lt;/P&gt;&lt;P&gt;Tom- Thanks for your %sysfunc solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure which solution I will end up using, but I'm not going to have unbalanced quotes any more.&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 15:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111431#M23080</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2013-07-22T15:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro and where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111432#M23081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about using contains operator instead of quoting them ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where "&amp;amp;var1" contains strip(id) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where indexw("&amp;amp;var1",strip(id));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;消息编辑者为：xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 01:35:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-and-where/m-p/111432#M23081</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-07-23T01:35:34Z</dc:date>
    </item>
  </channel>
</rss>

