<?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: Multiple like() statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125434#M34481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to make your code work, but I got it to work in a really poor way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set bkm.alertes_bankmate_conv;&lt;BR /&gt;by objet;&lt;BR /&gt;retain count_gafi count_sanction count_person ;&lt;/P&gt;&lt;P&gt;switch = "n";&lt;/P&gt;&lt;P&gt;if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_gafi=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_sanction=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_person=0;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if index(lowcase(strip(objet)),'bolivie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'équateur')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'equateur')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'éthiopie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'ethiopie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'indonésie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'indonesie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'kenya')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'nigeria')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'nigéria')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'pakistan')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'sao')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'sri lanka')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'thailand')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'tailand')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'turquie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'tanzanie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'viet')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'yemen')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'yémen')&amp;gt;0&amp;nbsp; then do;&lt;BR /&gt;count_gafi=count_gafi+1;&lt;BR /&gt;switch = "y";&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if index(lowcase(strip(objet)),'bélarus')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'belarus' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'corée du nord' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'rpdc' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'coree du nord')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'ivoire'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'congo' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'chine' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'cuba'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'érythrée' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'erythree')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'iran'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'iraq' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'liberia'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'libéria' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'libye'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'myanmar' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'birmanie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'somalie'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'sierra' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'soudan')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'syrie' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'zimbabwe')&amp;gt;0 &lt;BR /&gt;then do;&lt;BR /&gt;count_sanction=count_sanction+1;&lt;BR /&gt;switch = "y";&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if switch ="n" then do;&lt;BR /&gt;count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I would like to know what is the most efficient way to write the above and how to create a distinct table only with the count_sanction, count_gafi and count_person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help and time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Mar 2013 23:11:40 GMT</pubDate>
    <dc:creator>nicnad</dc:creator>
    <dc:date>2013-03-01T23:11:40Z</dc:date>
    <item>
      <title>Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125421#M34468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table named mytable with a column named object. I want to count the number of records that contains the string test1 test2 or test3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the proper way to write this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 19:52:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125421#M34468</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T19:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125422#M34469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicnad,&lt;/P&gt;&lt;P&gt;Following below code will give the count of the records in mytable1 dataset.&lt;/P&gt;&lt;P&gt;Proc sort data=mytable;&lt;BR /&gt;by object;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data mytable1&lt;SPAN style="color: #ff0000;"&gt;(keep=count)&lt;/SPAN&gt;;&lt;BR /&gt;set mytable &lt;SPAN style="color: #ff0000;"&gt;end=eof&lt;/SPAN&gt;;&lt;BR /&gt;by object;&lt;BR /&gt;retain count;&lt;BR /&gt;if _n_ eq 1 then count=0;&lt;BR /&gt;if lowcase(strip(object)) in ('test1','test2','test3') then count=count+1;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;if eof;&lt;/SPAN&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to have all data in the mytable1 remove the word i highlighted in red.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 21:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125422#M34469</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-01T21:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125423#M34470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another possibility:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value $findme&lt;/P&gt;&lt;P&gt;'test1', 'test2', 'test3' = 'test1+test2+test3'&amp;nbsp; other='Other value';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=mytable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables object;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; format object $findme.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some questions to consider:&amp;nbsp; Is upper case vs. lower case important?&amp;nbsp; Does "contains" mean an exact match, or does "contains" include cases where "test1" appears in the middle of the value of OBJECT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 21:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125423#M34470</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-03-01T21:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125424#M34471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for your the quick replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want my code to be case unsensitive, so I think that using lowcase and expressing the conditions in lower cases is the right way to go.&lt;/P&gt;&lt;P&gt;I want to count object that contains specific value, not an exact match ( I want to count cases where the specific string appear in the middle of the value object).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also like the results to be in a distinct table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my real code, but it does not work. Can you please help me fix it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set mylib.test end=eof;&lt;BR /&gt;by objet;&lt;BR /&gt;retain count_gafi count_sanction count_person;&lt;BR /&gt;if _n_ eq 1 then count_gafi=0 count_sanction=0 count_person=0;&lt;BR /&gt;if lowcase(strip(objet)) in ("bolivie","équateur","equateur","éthiopie","ethiopie","indonesie","kenya",&lt;BR /&gt;"nigeria","nigéria","pakistan", "sao","sri lanka", "thailand", "thailande","tailande","turquie",&lt;BR /&gt;"tanzanie","viet","yemen","yémen")&lt;BR /&gt;then count_gafi=count_gafi+1;&lt;BR /&gt;else if lowcase(strip(objet)) in ("bélarus","belarus", "corée du nord", "rpdc", "coree du nord","ivoire" , &lt;BR /&gt;"congo", "chine" , "cuba" , "érythrée" , "erythree", "iran" , "iraq" , "liberia" , "libéria", "libye" , &lt;BR /&gt;"myanmar", "birmanie", "somalie" , "sierra" , "soudan", "syrie", "zimbabwe")&lt;BR /&gt;then count_sanction=count_sanction+1;&lt;BR /&gt;else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;/P&gt;&lt;P&gt;if eof;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help and time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 21:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125424#M34471</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T21:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125425#M34472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicnad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;if lowcase(strip(object))&lt;/SPAN&gt;&amp;nbsp; in code use the below code&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if&amp;nbsp; index(lowcase(strip(object)), &lt;SPAN style="font-size: 12pt;"&gt;"&lt;/SPAN&gt; 'bolive','equater'...&lt;SPAN style="font-size: 12pt;"&gt;"&lt;/SPAN&gt;)&amp;nbsp; &amp;gt;&amp;nbsp; 0&lt;/SPAN&gt; then count=count+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 21:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125425#M34472</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-01T21:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125426#M34473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not able to make it work... can you please help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set mylist.test end=eof;&lt;BR /&gt;by objet;&lt;BR /&gt;retain count_gafi count_sanction count_person;&lt;BR /&gt;if index(lowcase(strip(objet)),"'bolivie','équateur','equateur','éthiopie','ethiopie','indonesie','kenya',&lt;BR /&gt;'nigeria','nigéria','pakistan', 'sao','sri lanka', 'thailand', 'thailande','tailande','turquie',&lt;BR /&gt;'tanzanie','viet','yemen','yémen'")&lt;BR /&gt;then count_gafi=count_gafi+1;&lt;BR /&gt;else if index(lowcase(strip(objet)),"'bélarus','belarus', 'corée du nord', 'rpdc', 'coree du nord','ivoire' , &lt;BR /&gt;'congo', 'chine' , 'cuba' , 'érythrée' , 'erythree', 'iran' , 'iraq' , 'liberia' , 'libéria', 'libye' , &lt;BR /&gt;'myanmar', 'birmanie', 'somalie' , 'sierra' , 'soudan', 'syrie', 'zimbabwe'")&lt;BR /&gt;then count_sanction=count_sanction+1;&lt;BR /&gt;else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;/P&gt;&lt;P&gt;if eof;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125426#M34473</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T22:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125427#M34474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicnad,&lt;/P&gt;&lt;P&gt;If you want assign two variables as zero in the following code if _n_ eq 1 then count_gafi=0 count_sanction=0 count_person=0;&lt;/P&gt;&lt;P&gt;You have to go for do statement and place semicolon at end of each variable assignement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex.&lt;/P&gt;&lt;P&gt;if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;count_gafi=0;&lt;/P&gt;&lt;P&gt;count_sanction=0;&lt;/P&gt;&lt;P&gt;count_person=0;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:08:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125427#M34474</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-01T22:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125428#M34475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me make this piece of code work :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set mylist.test end=eof;&lt;BR /&gt;by objet;&lt;BR /&gt;retain count_gafi count_sanction count_person;&lt;BR /&gt;if index(lowcase(strip(objet)),"'bolivie','équateur','equateur','éthiopie','ethiopie','indonesie','kenya',&lt;BR /&gt;'nigeria','nigéria','pakistan', 'sao','sri lanka', 'thailand', 'thailande','tailande','turquie',&lt;BR /&gt;'tanzanie','viet','yemen','yémen'")&amp;gt;0&lt;BR /&gt;then count_gafi=count_gafi+1;&lt;BR /&gt;else if index(lowcase(strip(objet)),"'bélarus','belarus', 'corée du nord', 'rpdc', 'coree du nord','ivoire' , &lt;BR /&gt;'congo', 'chine' , 'cuba' , 'érythrée' , 'erythree', 'iran' , 'iraq' , 'liberia' , 'libéria', 'libye' , &lt;BR /&gt;'myanmar', 'birmanie', 'somalie' , 'sierra' , 'soudan', 'syrie', 'zimbabwe'")`&amp;gt;0&lt;BR /&gt;then count_sanction=count_sanction+1;&lt;BR /&gt;else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;/P&gt;&lt;P&gt;if eof;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125428#M34475</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T22:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125429#M34476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicnad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have highlighted with red font for the changes i have made in the below code, adding that to your code it will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set mylist.test end=eof;&lt;BR /&gt;by objet;&lt;BR /&gt;retain count_gafi count_sanction count_person;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if _n_ eq 1 then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_gafi=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_sanction=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_person=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;end;&lt;/SPAN&gt;&lt;BR /&gt;if index(lowcase(strip(objet)),"'bolivie','équateur','equateur','éthiopie','ethiopie','indonesie','kenya',&lt;BR /&gt;'nigeria','nigéria','pakistan', 'sao','sri lanka', 'thailand', 'thailande','tailande','turquie',&lt;BR /&gt;'tanzanie','viet','yemen','yémen'")&lt;BR /&gt;then count_gafi=count_gafi+1;&lt;BR /&gt;else if index(lowcase(strip(objet)),"'bélarus','belarus', 'corée du nord', 'rpdc', 'coree du nord','ivoire' , &lt;BR /&gt;'congo', 'chine' , 'cuba' , 'érythrée' , 'erythree', 'iran' , 'iraq' , 'liberia' , 'libéria', 'libye' , &lt;BR /&gt;'myanmar', 'birmanie', 'somalie' , 'sierra' , 'soudan', 'syrie', 'zimbabwe'")&lt;BR /&gt;then count_sanction=count_sanction+1;&lt;BR /&gt;else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;/P&gt;&lt;P&gt;if eof;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125429#M34476</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-01T22:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125430#M34477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The count does not work properly it does not count records the contains the given strings... Do you know what might cause this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125430#M34477</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T22:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125431#M34478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicnad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add the conditional statement in red font and delete the statement in blue font,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set mylist.test end=eof;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;by objet; /*delete the statement, it might create problem in future if the data is not sorted based on objet*/&lt;/SPAN&gt;&lt;BR /&gt;retain count_gafi count_sanction count_person;&lt;/P&gt;&lt;P&gt;if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_gafi=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_sanction=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_person=0;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;if index(lowcase(strip(objet)),"'bolivie','équateur','equateur','éthiopie','ethiopie','indonesie','kenya',&lt;BR /&gt;'nigeria','nigéria','pakistan', 'sao','sri lanka', 'thailand', 'thailande','tailande','turquie',&lt;BR /&gt;'tanzanie','viet','yemen','yémen'")&lt;SPAN style="color: #ff0000;"&gt; &amp;gt;0&lt;/SPAN&gt;&lt;BR /&gt;then count_gafi=count_gafi+1;&lt;BR /&gt;else if index(lowcase(strip(objet)),"'bélarus','belarus', 'corée du nord', 'rpdc', 'coree du nord','ivoire' , &lt;BR /&gt;'congo', 'chine' , 'cuba' , 'érythrée' , 'erythree', 'iran' , 'iraq' , 'liberia' , 'libéria', 'libye' , &lt;BR /&gt;'myanmar', 'birmanie', 'somalie' , 'sierra' , 'soudan', 'syrie', 'zimbabwe'") &lt;SPAN style="color: #ff0000;"&gt;&amp;gt;0&lt;/SPAN&gt;&lt;BR /&gt;then count_sanction=count_sanction+1;&lt;BR /&gt;else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;/P&gt;&lt;P&gt;if eof;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125431#M34478</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-01T22:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125432#M34479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The count still does not work properly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me fix this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125432#M34479</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T22:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125433#M34480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicnad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove the statement highlighted in the red font,you will get all the data and more details about the count variable increment. if you face other issue , could you please elaborate.&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set mylist.test end=eof;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain count_gafi count_sanction count_person;&lt;/P&gt;&lt;P&gt;if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_gafi=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_sanction=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_person=0;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;if index(lowcase(strip(objet)),"'bolivie','équateur','equateur','éthiopie','ethiopie','indonesie','kenya',&lt;BR /&gt;'nigeria','nigéria','pakistan', 'sao','sri lanka', 'thailand', 'thailande','tailande','turquie',&lt;BR /&gt;'tanzanie','viet','yemen','yémen'")&lt;SPAN style="color: #000000;"&gt; &amp;gt;0&lt;/SPAN&gt;&lt;BR /&gt;then count_gafi=count_gafi+1;&lt;BR /&gt;else if index(lowcase(strip(objet)),"'bélarus','belarus', 'corée du nord', 'rpdc', 'coree du nord','ivoire' , &lt;BR /&gt;'congo', 'chine' , 'cuba' , 'érythrée' , 'erythree', 'iran' , 'iraq' , 'liberia' , 'libéria', 'libye' , &lt;BR /&gt;'myanmar', 'birmanie', 'somalie' , 'sierra' , 'soudan', 'syrie', 'zimbabwe'") &lt;SPAN style="color: #000000;"&gt;&amp;gt;0&lt;/SPAN&gt;&lt;BR /&gt;then count_sanction=count_sanction+1;&lt;BR /&gt;else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if eof;&lt;/SPAN&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125433#M34480</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-01T22:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple like() statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125434#M34481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to make your code work, but I got it to work in a really poor way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;data data work.ind14_15_16;&lt;BR /&gt;set bkm.alertes_bankmate_conv;&lt;BR /&gt;by objet;&lt;BR /&gt;retain count_gafi count_sanction count_person ;&lt;/P&gt;&lt;P&gt;switch = "n";&lt;/P&gt;&lt;P&gt;if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_gafi=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_sanction=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_person=0;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if index(lowcase(strip(objet)),'bolivie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'équateur')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'equateur')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'éthiopie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'ethiopie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'indonésie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'indonesie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'kenya')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'nigeria')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'nigéria')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'pakistan')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'sao')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'sri lanka')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'thailand')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'tailand')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'turquie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'tanzanie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'viet')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'yemen')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'yémen')&amp;gt;0&amp;nbsp; then do;&lt;BR /&gt;count_gafi=count_gafi+1;&lt;BR /&gt;switch = "y";&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if index(lowcase(strip(objet)),'bélarus')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'belarus' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'corée du nord' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'rpdc' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'coree du nord')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'ivoire'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'congo' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'chine' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'cuba'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'érythrée' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'erythree')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'iran'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'iraq' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'liberia'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'libéria' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'libye'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'myanmar' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'birmanie')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'somalie'&amp;nbsp; )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'sierra' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'soudan')&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)), 'syrie' )&amp;gt;0 or&lt;BR /&gt;index(lowcase(strip(objet)),'zimbabwe')&amp;gt;0 &lt;BR /&gt;then do;&lt;BR /&gt;count_sanction=count_sanction+1;&lt;BR /&gt;switch = "y";&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if switch ="n" then do;&lt;BR /&gt;count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I would like to know what is the most efficient way to write the above and how to create a distinct table only with the count_sanction, count_gafi and count_person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help and time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 23:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-like-statement/m-p/125434#M34481</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-03-01T23:11:40Z</dc:date>
    </item>
  </channel>
</rss>

