<?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: Modifying existing code to go through several columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840557#M332340</link>
    <description>&lt;P&gt;Not sure what you mean by multiple columns.&amp;nbsp; Show some simple example data and the expected results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not clear what you are counting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't you just want to use the MAX() aggregate function to test if the term ever matched?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
,max(find(t1.col_name,t2.search_terms,'it') &amp;gt; 0) as any_match
group by ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Oct 2022 14:16:30 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-10-25T14:16:30Z</dc:date>
    <item>
      <title>Modifying existing code to go through several columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840529#M332336</link>
      <description>&lt;P&gt;&lt;STRONG&gt;The code actually doesn't work so I will need to go back and edit.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840529#M332336</guid>
      <dc:creator>Kaeslock223_</dc:creator>
      <dc:date>2022-10-25T14:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying existing code to go through several columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840547#M332339</link>
      <description>&lt;P&gt;Do loops do not exist in PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you could create a macro with a %DO loop and that should work in PROC SQL if you do it properly. However, since I really don't understand what you want to do (there are no columns A-E), I would need to understand the problem better in order to help.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840547#M332339</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-25T14:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying existing code to go through several columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840557#M332340</link>
      <description>&lt;P&gt;Not sure what you mean by multiple columns.&amp;nbsp; Show some simple example data and the expected results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not clear what you are counting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't you just want to use the MAX() aggregate function to test if the term ever matched?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
,max(find(t1.col_name,t2.search_terms,'it') &amp;gt; 0) as any_match
group by ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modifying-existing-code-to-go-through-several-columns/m-p/840557#M332340</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-25T14:16:30Z</dc:date>
    </item>
  </channel>
</rss>

