<?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: For each value in one variable check if in another variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644561#M192539</link>
    <description>Yes it sounds like I should just keep it simple.</description>
    <pubDate>Fri, 01 May 2020 17:04:20 GMT</pubDate>
    <dc:creator>TheRealHunterC</dc:creator>
    <dc:date>2020-05-01T17:04:20Z</dc:date>
    <item>
      <title>For each value in one variable check if in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644391#M192461</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm comparing two let variables that have multiple strings in each and I want to be able to tell if a string has been added to the second let variable. For an example if I have the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let all_codes_jan = a, b, c, d, e, f;&lt;BR /&gt;%let all_codes_march = a, b, c, d, e, f, g;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find that the code g was added and is a value in the second let variable that is not included in the first let variable. I have used in and not in before in proc sql but I dont know how to do this when there are many codes in each variable, and they are not columns in a table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help you can offer!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 21:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644391#M192461</guid>
      <dc:creator>TheRealHunterC</dc:creator>
      <dc:date>2020-04-30T21:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: For each value in one variable check if in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644397#M192462</link>
      <description>You're right.  SQL handles this type of problem easily, as long as you keep your data in data sets.  Why create macro variables when all they do is make the programming more complex?  Do you have a choice?</description>
      <pubDate>Thu, 30 Apr 2020 22:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644397#M192462</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-04-30T22:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: For each value in one variable check if in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644411#M192467</link>
      <description>&lt;P&gt;What does the result of your comparison actually look like? An assigned value to a macro variable, if so what does it look like? A value in a data set? A message written to the log or results window?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And is this "added" an "added at the end" (as your example implies) or "some value inserted into a random location"?&lt;/P&gt;
&lt;P&gt;Or what if the order of values changes? is "a,b,c" the same as "b,c,a"? If not, what is the result?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any particular reasons you are placing commas in the values? If you want to do this with macro coding then the presence of the commas will likely make the code much more complicated because the comma is the delimiter in functions.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 23:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644411#M192467</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-30T23:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: For each value in one variable check if in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644413#M192468</link>
      <description>&lt;P&gt;For your example (one-character strings), the verify macro would be useful.&lt;/P&gt;
&lt;P&gt;See here&amp;nbsp;&lt;A href="https://www.lexjansen.com/phuse/2010/po/PO05.pdf" target="_blank" rel="noopener"&gt;https://www.lexjansen.com/phuse/2010/po/PO05.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 23:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644413#M192468</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-04-30T23:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: For each value in one variable check if in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644561#M192539</link>
      <description>Yes it sounds like I should just keep it simple.</description>
      <pubDate>Fri, 01 May 2020 17:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-each-value-in-one-variable-check-if-in-another-variable/m-p/644561#M192539</guid>
      <dc:creator>TheRealHunterC</dc:creator>
      <dc:date>2020-05-01T17:04:20Z</dc:date>
    </item>
  </channel>
</rss>

