<?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: How to find a match among different macro lists in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454310#M69962</link>
    <description>&lt;P&gt;So far, you have established four infinite loops.&amp;nbsp; I would fix those before worrying about the step that you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new macro you are asking for needs to increment &amp;amp;i, just as you have done in your earlier macros:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let i = %eval(&amp;amp;i + 1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without incrementing &amp;amp;i, the new macro runs forever.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And each of your existing macros needs to add this as the first statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%local i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without that, your existing 3 macros will use the same &amp;amp;i as the new macro, and will re-set &amp;amp;i to 1 repeatedly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of that is necessary just to be able to safely test any proposed code.&amp;nbsp; You will also need to deal with the fact that your existing macros look to process all variables in a list, not just a single variable.&amp;nbsp; So you need to modify your existing macros so that they will process just a single variable at a time.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With those steps in place, the programming can begin on your request.&lt;/P&gt;</description>
    <pubDate>Sun, 15 Apr 2018 22:49:04 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-04-15T22:49:04Z</dc:date>
    <item>
      <title>How to find a match among different macro lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454305#M69959</link>
      <description>&lt;P&gt;I have:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;numlist, which has&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;a list&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of numeric variables in a dataset&lt;BR /&gt;&amp;amp;datelist&lt;SPAN&gt;, which has&amp;nbsp;&lt;EM&gt;a list&lt;/EM&gt;&amp;nbsp;of date variables in a dataset&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&amp;amp;charlist&lt;SPAN&gt;, which has&amp;nbsp;&lt;EM&gt;a list&lt;/EM&gt;&amp;nbsp;of character variables in a dataset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;varordered, which has a list of all numeric, date, character variables of a dataset in alphabetical order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;numsum: summarizes a list of numeric variables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%macro&amp;nbsp;char&lt;/SPAN&gt;sum: summarizes a list of character variables&lt;/P&gt;&lt;P&gt;%macro&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;datesum: summarizes a list of date variables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make a macro function that takes in &amp;amp;varordered and runs one of the three macro&amp;nbsp;functions according to the variable type of the variables in the &amp;amp;varordered list. I'm doing this because I want to produce a summary output of every variable alphabetically.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm worried if taking in a list of num/char/date variables would be a problem though, since I would be feeding in one variable at a time, not a list of num/char/date, from &amp;amp;varordered.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To sketch the idea, I think this form would work for the macro?&amp;nbsp;&lt;BR /&gt;%macro (allvar= &amp;amp;varordered);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %let i=1;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%do %until (%scan(&amp;amp;allvar,&amp;amp;i)= );&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%let var=%scan(&amp;amp;allvar,&amp;amp;i);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;/* Here, I want to do: */&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;/* if the scanned variable in allvar is numeric (in &amp;amp;numlist), run a macro function called numsum */&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;/* if the scanned variable in allvar is character&amp;nbsp;&lt;SPAN&gt;(in &amp;amp;charlist)&lt;/SPAN&gt;, run a macro function called charsum */&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;/* if the scanned variable in allvar is a date variable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(in &amp;amp;datelist),&lt;/SPAN&gt;&amp;nbsp;run a macro function called datesum */&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%end;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;%mend allvar ;&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;&lt;P&gt;*************************************;&lt;/P&gt;&lt;P&gt;Code for one of the three macro functions I have fyi:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro charsum;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %let i=1;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%do %until (%scan(&amp;amp;charlist,&amp;amp;i)= );&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%let var=%scan(&amp;amp;charlist,&amp;amp;i);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;proc sql noprint;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;select count (distinct &amp;amp;var) into :valcount&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;from met.dema_669;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%if &amp;amp;valcount&amp;lt;=6 %then %do;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;proc freq data=met.dema_669;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;tables &amp;amp;var / missing;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;title "Frequency table for &amp;amp;var";&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;run;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%else %do;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;data _null_;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;file print;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;length sentence $200;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;sentence="Variable &amp;amp;var is not tabulated; all or most values unique";&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;put sentence;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;put _page_;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%end;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;title;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%let i= %eval(&amp;amp;i+1);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;%end;&lt;BR /&gt;%mend charsum;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 21:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454305#M69959</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2018-04-15T21:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a match among different macro lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454309#M69961</link>
      <description>&lt;P&gt;I don't see why it wouldn't work, if coded properly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 22:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454309#M69961</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-15T22:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a match among different macro lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454310#M69962</link>
      <description>&lt;P&gt;So far, you have established four infinite loops.&amp;nbsp; I would fix those before worrying about the step that you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new macro you are asking for needs to increment &amp;amp;i, just as you have done in your earlier macros:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let i = %eval(&amp;amp;i + 1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without incrementing &amp;amp;i, the new macro runs forever.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And each of your existing macros needs to add this as the first statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%local i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without that, your existing 3 macros will use the same &amp;amp;i as the new macro, and will re-set &amp;amp;i to 1 repeatedly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of that is necessary just to be able to safely test any proposed code.&amp;nbsp; You will also need to deal with the fact that your existing macros look to process all variables in a list, not just a single variable.&amp;nbsp; So you need to modify your existing macros so that they will process just a single variable at a time.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With those steps in place, the programming can begin on your request.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 22:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454310#M69962</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-15T22:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a match among different macro lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454315#M69965</link>
      <description>&lt;P&gt;Thank you, I've changed the three macros to take in one variable&amp;nbsp;only (by deleting the loops) and because of that, they don't have i anymore.&lt;/P&gt;&lt;P&gt;And yes, I forgot to add %eval(&amp;amp;i+1) and have added that line at the end of the macro I want to make.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, how do we check if a scanned variable in &amp;amp;allvar is in any of &amp;amp;numlist/&amp;amp;charlist/&amp;amp;datelist and run one of the&amp;nbsp;macro functions numsum/charsum/datesum&amp;nbsp;accordingly?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 23:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454315#M69965</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2018-04-15T23:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a match among different macro lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454321#M69966</link>
      <description>&lt;P&gt;The exterior macro has already identified the next name to process as &amp;amp;VAR.&amp;nbsp; Here's one way to search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %sysfunc(findw(&amp;amp;numlist, &amp;amp;var)) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If for any reason you want to stick to purely macro language functions, it can be done but is clumsy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %index(%str( &amp;amp;numlist ), %str( &amp;amp;var )) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The leading and trailing blanks are now treated as significant characters, a requirement for the proper result.&amp;nbsp; You don't want the search for VAR1 to locate a match if the software finds VAR11.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 23:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-a-match-among-different-macro-lists/m-p/454321#M69966</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-15T23:51:48Z</dc:date>
    </item>
  </channel>
</rss>

