<?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 How to search variable values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499601#M132971</link>
    <description>&lt;P&gt;I have a dataset having 50 variables and over a million observations. I wanted to search the cpt code value like '55963' in the entire dataset. I know the value exists in 2 or 3 variables, but not sure about the column/variable name. Basic&amp;nbsp;code with filters in variable&amp;nbsp;name takes&amp;nbsp; longer time to process. Is there any way to code in Macro or efficient way to code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for Looking!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Sep 2018 16:56:13 GMT</pubDate>
    <dc:creator>Kalai2008</dc:creator>
    <dc:date>2018-09-27T16:56:13Z</dc:date>
    <item>
      <title>How to search variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499601#M132971</link>
      <description>&lt;P&gt;I have a dataset having 50 variables and over a million observations. I wanted to search the cpt code value like '55963' in the entire dataset. I know the value exists in 2 or 3 variables, but not sure about the column/variable name. Basic&amp;nbsp;code with filters in variable&amp;nbsp;name takes&amp;nbsp; longer time to process. Is there any way to code in Macro or efficient way to code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for Looking!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 16:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499601#M132971</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2018-09-27T16:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to search variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499605#M132973</link>
      <description>&lt;P&gt;That leads you to wanting to learn the concept of indexes. Welcome to the club as I have just begun(today) reading Michael Raithel(king of indexes) book "&lt;A href="https://support.sas.com/en/books/authors/michael-raithel.html" target="_blank"&gt;https://support.sas.com/en/books/authors/michael-raithel.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499605#M132973</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-27T17:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499614#M132976</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86703"&gt;@Kalai2008&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset having 50 variables and over a million observations. I wanted to search the cpt code value like '55963' in the entire dataset. I know the value exists in 2 or 3 variables, but not sure about the column/variable name. &lt;FONT color="#0000ff"&gt;Basic&amp;nbsp;code with filters in variable&amp;nbsp;name&lt;/FONT&gt; takes&amp;nbsp; longer time to process. Is there any way to code in Macro or efficient way to code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for Looking!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Let's start from there. Please show us what code you tried.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499614#M132976</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-09-27T17:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to search variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499629#M132981</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86703"&gt;@Kalai2008&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset having 50 variables and over a million observations. I wanted to search the cpt code value like '55963' in the entire dataset. I know the value exists in 2 or 3 variables, but not sure about the column/variable name. Basic&amp;nbsp;code with filters in variable&amp;nbsp;name takes&amp;nbsp; longer time to process. Is there any way to code in Macro or efficient way to code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for Looking!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One way, untested of course as not actual example data provided:&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   array _c_ _character_;
   length _vname_ $ 32.;
   do i= 1 to dim(_c_);
      if _c_[i]='55963' then do;
         _vname_= vname(_c_[i]); 
         record=_n_;
         output;
      end;
   end;
   keep _vname_ record;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to run proc freq on that set if the value occurs frequently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Extensions if there are number of character values would be to create a temporary array, include a loop to test each _c_ element against the temporary array values and include the temporary array value in a value variable in the output set.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499629#M132981</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-27T17:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to search variable values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499642#M132986</link>
      <description>&lt;P&gt;Thank you, it worked. I need to modify the code as the value&amp;nbsp;also &amp;nbsp;exists in another variable. Thanks for your inputs.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 18:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-search-variable-values/m-p/499642#M132986</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2018-09-27T18:20:32Z</dc:date>
    </item>
  </channel>
</rss>

