<?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 Output fuzzy matching results in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352173#M23236</link>
    <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with a number of string variables. The actual values in these reference variables in a number of datsets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is search these variables for references to particular words.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table alldata as
   select *
   from dictionary.columns
   where libname in ('X2011','X2012','X2013','X2014','X2015')
   order by libname, memname
   ;  
quit;


data alldat1 (keep=libname memname name type label) ;
set alldata;
value=spedis(label, ' income ');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So from the example I would like to tell SAS to search the variable label for any reference to the string income.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if this is the correct function to use for this feature?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given these labels are basically sentences I'm not sure if SAS will be able to look for something such as income?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is welcome.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Apr 2017 13:47:47 GMT</pubDate>
    <dc:creator>Sean_OConnor</dc:creator>
    <dc:date>2017-04-21T13:47:47Z</dc:date>
    <item>
      <title>Output fuzzy matching results</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352173#M23236</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with a number of string variables. The actual values in these reference variables in a number of datsets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is search these variables for references to particular words.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table alldata as
   select *
   from dictionary.columns
   where libname in ('X2011','X2012','X2013','X2014','X2015')
   order by libname, memname
   ;  
quit;


data alldat1 (keep=libname memname name type label) ;
set alldata;
value=spedis(label, ' income ');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So from the example I would like to tell SAS to search the variable label for any reference to the string income.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if this is the correct function to use for this feature?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given these labels are basically sentences I'm not sure if SAS will be able to look for something such as income?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is welcome.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 13:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352173#M23236</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2017-04-21T13:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Output fuzzy matching results</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352199#M23242</link>
      <description>&lt;P&gt;You don't actually say what you are trying to accomplish.&lt;/P&gt;
&lt;P&gt;Since you are not keeping the value of your "value" variable I am going to guess that what your attempting is to select records where the word 'income' appears in the label. If that is the case I would start with:&lt;/P&gt;
&lt;PRE&gt;data alldat1 (keep=libname memname name type label) ;
   set alldata;
   if findw(label, 'income',' ,.','i');
run;&lt;/PRE&gt;
&lt;P&gt;The 'i' parameter says to ignore case so Income INCOME income all match the selection. The Findw will return a value greater than 0 if the word is found and so is considered "true" for the If and that form of IF selects records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ' ,.' says to treat those characters as word separators. If you have other punctualtion such as : that may appear then add that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is not what you want then provide an example of what the output data set should actually look like.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 14:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352199#M23242</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-21T14:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Output fuzzy matching results</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352211#M23246</link>
      <description>&lt;P&gt;Excellent! This is exactly the kind of thing I was looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to increase the search criteria in the one data step to look for a number of different words? Something such as,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data alldat1 (keep=libname memname name type label) ;
   set alldata;
   if type ='char' then delete;
   if findw(label, 'income',' ,.','i'); 
   if findw(label, 'dividends',' ,.','d');
   if findw(label, 'salary',' ,.','s');
 if findw(label, 'pay',' ,.','p');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 15:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352211#M23246</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2017-04-21T15:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Output fuzzy matching results</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352224#M23248</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116786"&gt;@Sean_OConnor&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Excellent! This is exactly the kind of thing I was looking for.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to increase the search criteria in the one data step to look for a number of different words? Something such as,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data alldat1 (keep=libname memname name type label) ;
   set alldata;
   if type ='char' then delete;
   if findw(label, 'income',' ,.','i'); 
   if findw(label, 'dividends',' ,.','d');
   if findw(label, 'salary',' ,.','s');
 if findw(label, 'pay',' ,.','p');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One If Findw with OR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data alldat1 (keep=libname memname name type label) ;
   set alldata;
   if type ='char' then delete;
   if findw(label, 'income',' ,.','i') 
      or findw(label, 'dividends',' ,.','d')
      or findw(label, 'salary',' ,.','s')
      or findw(label, 'pay',' ,.','p');
run;&lt;/PRE&gt;
&lt;P&gt;If you want any label that matches at least one of the conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 15:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-fuzzy-matching-results/m-p/352224#M23248</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-21T15:56:17Z</dc:date>
    </item>
  </channel>
</rss>

