<?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: Compare values in the same column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394019#M94914</link>
    <description>&lt;P&gt;this program will give you a list of the words in your long text string;&lt;/P&gt;&lt;P&gt;the frequency listing will show you you how many occurrences.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA unique(keep = word);
     attrib word length = $32;*need to increase?;
     drop _:; *_temp vars;
set long_text_strings;
do _i = 1 to countw(text,' ');
   word = scan(text,_i);
   output;
   end;
run;
PROC freq data   = &amp;amp;syslast
          order  = freq;
          tables   word /list /* noprint */
             out = list_words;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then make a list of the words you want to find.&lt;/P&gt;&lt;P&gt;make a variable for each word&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run a similar loop where you indicate found in the variable&lt;/P&gt;&lt;P&gt;and then do a cross-tabulation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a start, eh?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron Fehd search, find, xtab maven&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2017 19:39:05 GMT</pubDate>
    <dc:creator>Ron_MacroMaven</dc:creator>
    <dc:date>2017-09-07T19:39:05Z</dc:date>
    <item>
      <title>Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394006#M94909</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem, my problem is that I have a open text column with data that I have to find all distincts but the date has diferences in many rows, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Description&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AMK 100 MG AMP CAT4000173&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 100 MG AMP REF4000173&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AMK 500 MG AMP 2 MLREF 4000174&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 500 MG AMP 2 MLREF4000174&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 500 MGAMP 2 MLREF4000174&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AMILASA EN SANGRE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMILASA EN SANGRE P&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 1000&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA P REF 4000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 1000&amp;nbsp; BOTE PLATICO&amp;nbsp; PISA P REF 40002&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 500&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA REF400025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 500&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA REF4000255&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I need to a group all of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 19:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394006#M94909</guid>
      <dc:creator>CEHA55</dc:creator>
      <dc:date>2017-09-07T19:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394011#M94911</link>
      <description>&lt;P&gt;Can you show how that data should be grouped?&lt;/P&gt;
&lt;P&gt;Generally one approach would be to "extract" the values of interest into another variable or variables and then work with the extracted values.&lt;/P&gt;
&lt;P&gt;You haven't provided much in the way to identify what would need to be extracted or what you would expect the result to look like when finished.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 19:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394011#M94911</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-07T19:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394019#M94914</link>
      <description>&lt;P&gt;this program will give you a list of the words in your long text string;&lt;/P&gt;&lt;P&gt;the frequency listing will show you you how many occurrences.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA unique(keep = word);
     attrib word length = $32;*need to increase?;
     drop _:; *_temp vars;
set long_text_strings;
do _i = 1 to countw(text,' ');
   word = scan(text,_i);
   output;
   end;
run;
PROC freq data   = &amp;amp;syslast
          order  = freq;
          tables   word /list /* noprint */
             out = list_words;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then make a list of the words you want to find.&lt;/P&gt;&lt;P&gt;make a variable for each word&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run a similar loop where you indicate found in the variable&lt;/P&gt;&lt;P&gt;and then do a cross-tabulation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a start, eh?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron Fehd search, find, xtab maven&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 19:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394019#M94914</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2017-09-07T19:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394021#M94916</link>
      <description>&lt;P&gt;I´m looking for something like this, the problem is that I have more than 60,000 of rows and I need to find all similars&amp;nbsp;&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;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Description&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Description_grouped&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 100 MG AMP CAT4000173&lt;/TD&gt;&lt;TD&gt;AMK 100 MG AMP&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 100 MG AMP REF4000173&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 500 MG AMP 2 MLREF 4000174&lt;/TD&gt;&lt;TD&gt;AMK 500 MG AMP 2&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 500 MG AMP 2 MLREF4000174&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMK 500 MGAMP 2 MLREF4000174&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMILASA EN SANGRE&lt;/TD&gt;&lt;TD&gt;AMILASA EN SANGRE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AMILASA EN SANGRE P&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 1000&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA P REF 4000&lt;/TD&gt;&lt;TD&gt;AGUA PIRRIGAR 1000&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 1000&amp;nbsp; BOTE PLATICO&amp;nbsp; PISA P REF 40002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 500&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA REF400025&lt;/TD&gt;&lt;TD&gt;AGUA PIRRIGAR 500&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AGUA PIRRIGAR 500&amp;nbsp; BOTE PLASTICO&amp;nbsp; PISA REF4000255&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 19:39:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394021#M94916</guid>
      <dc:creator>CEHA55</dc:creator>
      <dc:date>2017-09-07T19:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394030#M94919</link>
      <description>&lt;P&gt;Do you have any rules involved? Such as ignore everything after MLREF, CAT, REF or " P "?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 20:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394030#M94919</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-07T20:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394056#M94928</link>
      <description>&lt;P&gt;No, I don´t have any rul jey, I it will help, but not with those that miss an space in the meddile&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 21:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394056#M94928</guid>
      <dc:creator>CEHA55</dc:creator>
      <dc:date>2017-09-07T21:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in the same column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394137#M94940</link>
      <description>&lt;P&gt;data WANT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set HAE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length GROUP $50;&lt;/P&gt;&lt;P&gt;re=prxparse('s/REF/""/');&lt;/P&gt;&lt;P&gt;POS=prxmatch(RE,DESC);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if POS=0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; re=prxparse('s/CAT/""/');&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; POS=prxmatch(RE,DESC);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if POS=0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; re=prxparse('s/sP/""/');&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; POS=prxmatch(RE,DESC);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;GROUP=sbsustr(DESC,sum(POS,-1));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if scan(GROUP,-1,"")='P' then GROUP=substr(GROUP,1,length(GROUP)-1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I bet some contributors can help and make this code even better. &amp;nbsp;But it does the work, for now.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 05:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-in-the-same-column/m-p/394137#M94940</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-09-08T05:57:16Z</dc:date>
    </item>
  </channel>
</rss>

