<?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: IN a LIST in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635299#M35736</link>
    <description>&lt;P&gt;So you want to flag the two first records, correct?&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2020 12:54:13 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-03-27T12:54:13Z</dc:date>
    <item>
      <title>IN a LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635297#M35735</link>
      <description>&lt;P&gt;Now I have 2 tables,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data table1&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;column1&lt;/TD&gt;&lt;TD&gt;column2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;E1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;AE2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and reference table 2&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;column1&lt;/TD&gt;&lt;TD&gt;column2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;E1,AE2,3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I want to implement is to create a matching flag calculation like the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;case
when t1.column1 = t2.column1 and t1.column2 in t2.column2
then 1
else 0
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it has a syntax error. any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 12:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635297#M35735</guid>
      <dc:creator>jyu068</dc:creator>
      <dc:date>2020-03-27T12:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: IN a LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635299#M35736</link>
      <description>&lt;P&gt;So you want to flag the two first records, correct?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 12:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635299#M35736</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-27T12:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: IN a LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635300#M35737</link>
      <description>hi I want to flag the rows in t1 which column1 has the same value as t2.column1 and t1 column2's value is one of the t2 column2 value.&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 27 Mar 2020 12:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635300#M35737</guid>
      <dc:creator>jyu068</dc:creator>
      <dc:date>2020-03-27T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: IN a LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635301#M35738</link>
      <description>&lt;P&gt;Your table 2 isn't a reference table.&amp;nbsp; It's a nightmare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The programming cam be done, but you need to do it each time you want to use the reference table.&amp;nbsp; Instead of that, convert table2 so that it has the same format as table 1.&amp;nbsp; That will simplify the matching process and make it very flexible.&amp;nbsp; Merging, hashing, formats all become possible techniques with a better structure for the reference table.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635301#M35738</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-03-27T13:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: IN a LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635302#M35739</link>
      <description>&lt;P&gt;IN operator is for test a series of values, not search in a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the INDEXW() function (or FINDW() function) to check if a word exists in a delimited string.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635302#M35739</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-27T13:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: IN a LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635303#M35740</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input column1 $ column2 $;
datalines;
A E1
A AE2
A 5
;

data b;
input column1 $ column2 $;
datalines;
A E1,AE2,3
;

data c;
   merge a b (rename=column2=column3);
   by column1;
   dummy = indexw(column3, trim(column2), ',') &amp;gt; 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/IN-a-LIST/m-p/635303#M35740</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-27T13:22:50Z</dc:date>
    </item>
  </channel>
</rss>

