<?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 sas string exact and not exact matching in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241628#M44794</link>
    <description>&lt;P&gt;HI i have a base dataset as bigdata.&lt;/P&gt;&lt;P&gt;which contains some datalines like.&lt;/P&gt;&lt;P&gt;sumit chohan&lt;/P&gt;&lt;P&gt;sumeet chauhan&lt;/P&gt;&lt;P&gt;sumit chouhan&lt;/P&gt;&lt;P&gt;pratik dahibhat&lt;/P&gt;&lt;P&gt;prateek dahibat&lt;/P&gt;&lt;P&gt;partik dahibhat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and sample dataset which contains&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;summit chauhan&lt;/P&gt;&lt;P&gt;prateek dahibhat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i just wanted to find out the count of the possible matches as well as want to extract the possible matches from base dataset which is in&amp;nbsp; our case bigdata.&lt;/P&gt;&lt;P&gt;Please suggest if any.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prashant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jan 2016 12:59:24 GMT</pubDate>
    <dc:creator>prashantchitta4</dc:creator>
    <dc:date>2016-01-04T12:59:24Z</dc:date>
    <item>
      <title>sas string exact and not exact matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241628#M44794</link>
      <description>&lt;P&gt;HI i have a base dataset as bigdata.&lt;/P&gt;&lt;P&gt;which contains some datalines like.&lt;/P&gt;&lt;P&gt;sumit chohan&lt;/P&gt;&lt;P&gt;sumeet chauhan&lt;/P&gt;&lt;P&gt;sumit chouhan&lt;/P&gt;&lt;P&gt;pratik dahibhat&lt;/P&gt;&lt;P&gt;prateek dahibat&lt;/P&gt;&lt;P&gt;partik dahibhat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and sample dataset which contains&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;summit chauhan&lt;/P&gt;&lt;P&gt;prateek dahibhat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i just wanted to find out the count of the possible matches as well as want to extract the possible matches from base dataset which is in&amp;nbsp; our case bigdata.&lt;/P&gt;&lt;P&gt;Please suggest if any.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prashant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 12:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241628#M44794</guid>
      <dc:creator>prashantchitta4</dc:creator>
      <dc:date>2016-01-04T12:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: sas string exact and not exact matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241629#M44795</link>
      <description>&lt;P&gt;Well, there's several ways you could do this, probably the way I would do it is:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set small_data end=last;
  if _n_=1 then call execute('data want end=last;  set bigdata; retain count;');
  call execute('if index(variable,"',snippet,'") &amp;gt; 0 then count=sum(count,1);');
  if last then call execute(' if last then output; run;');
run;&lt;/PRE&gt;
&lt;P&gt;This assumes that you have small_data which contains a variable snippet, and a dataset bigdata with a variable called variable. &amp;nbsp;This will generate a datastep with an if statement for each row of your small data, and output one row with the total. &amp;nbsp;As you want the snippets maybe also add:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set small_data end=last;
  if _n_=1 then call execute('data want end=last matches;  set bigdata; retain count;');
  call execute('if index(variable,"',snippet,'") &amp;gt; 0 then do; count=sum(count,1); ouput matches; end;');
  if last then call execute(' if last then output want; run;');
run;&lt;/PRE&gt;
&lt;P&gt;You could also do the same via merging the two datasets. &amp;nbsp;Also depends on how your data looks, does casing match, how good is the match etc.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 13:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241629#M44795</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-04T13:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: sas string exact and not exact matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241630#M44796</link>
      <description>&lt;P&gt;Thank you so much for your reply...&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 13:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241630#M44796</guid>
      <dc:creator>prashantchitta4</dc:creator>
      <dc:date>2016-01-04T13:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: sas string exact and not exact matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241634#M44798</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can try Sounds like operator, anyhow it's designed for english so there may be somme difficulties with indian names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input name $ 1-32;&lt;BR /&gt;cards;&lt;BR /&gt;sumit chohan&amp;nbsp;&amp;nbsp;&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;BR /&gt;sumeet chauhan&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;BR /&gt;sumit chouhan&amp;nbsp;&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;BR /&gt;pratik dahibhat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;prateek dahibat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;partik dahibhat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data sample;&lt;BR /&gt;input name $ 1-32;&lt;BR /&gt;cards;&lt;BR /&gt;summit chauhan&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;BR /&gt;prateek dahibhat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select h.name as have_name, s.name as sample_name&lt;BR /&gt;from&amp;nbsp;&amp;nbsp; have h,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sample s&lt;BR /&gt;where&amp;nbsp; s.name = *h.name;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 13:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-string-exact-and-not-exact-matching/m-p/241634#M44798</guid>
      <dc:creator>AskoLötjönen</dc:creator>
      <dc:date>2016-01-04T13:19:27Z</dc:date>
    </item>
  </channel>
</rss>

