<?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 Any easy way to look for a value in multiple columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175390#M264630</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 around 80 columns (Col1 to Col80). These columns have city names. I need to look through all columns and see if there in city 'London'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done this by Concatinating the column values and looking for string 'London' but I am hoping there must be an easier way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other alternative I was thinking was arrays but I don't want to create another 80 variables or change the values of existing ones. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks as always. &lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2014 08:08:05 GMT</pubDate>
    <dc:creator>sachin01663</dc:creator>
    <dc:date>2014-11-18T08:08:05Z</dc:date>
    <item>
      <title>Any easy way to look for a value in multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175390#M264630</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 around 80 columns (Col1 to Col80). These columns have city names. I need to look through all columns and see if there in city 'London'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done this by Concatinating the column values and looking for string 'London' but I am hoping there must be an easier way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other alternative I was thinking was arrays but I don't want to create another 80 variables or change the values of existing ones. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks as always. &lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 08:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175390#M264630</guid>
      <dc:creator>sachin01663</dc:creator>
      <dc:date>2014-11-18T08:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Any easy way to look for a value in multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175391#M264631</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;Well, you don't need to create new variables in the array:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; col1="New York"; col2="London"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array col{2};&lt;/P&gt;&lt;P&gt;&amp;nbsp; if find(cats(of col{*}),"London")&amp;gt;0 then Flag="Y";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175391#M264631</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-11-18T09:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Any easy way to look for a value in multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175392#M264632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yet other ways ..&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array k _character_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 'London' IN k then put 'Found';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use:&lt;/P&gt;&lt;P&gt;whichC('London', of k&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 09:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-easy-way-to-look-for-a-value-in-multiple-columns/m-p/175392#M264632</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2014-11-18T09:58:13Z</dc:date>
    </item>
  </channel>
</rss>

