<?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: Trying to filter data show that it only shows me variables with six digits only in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642392#M191622</link>
    <description>&lt;P&gt;If you entered SS numbers as numbers then you need to watch out for LEADING zeros.&lt;/P&gt;
&lt;P&gt;To convert/display the numbers as 9 digit strings with leading zeros use the Z format.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 19:53:06 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-04-23T19:53:06Z</dc:date>
    <item>
      <title>Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642353#M191595</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am using survey data and I have two variables low_soc_code and upper_soc_code. Some of the these variables have six digits and some have eight. I want to only see the six digit low_soc_code and upper_soc_code? Any suggestions? I was thinking about using the where or substr function.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 18:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642353#M191595</guid>
      <dc:creator>Jssa8423</dc:creator>
      <dc:date>2020-04-23T18:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642374#M191609</link>
      <description>&lt;P&gt;Are these variables numeric or character?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the variable is character then you can use LENGTH (or Klength if using a double-byte character language) function to return the number of characters in a string.&amp;nbsp;&amp;nbsp; So something like : If length(variable) = 6 (and Length(othervariable) =6 if you need both) to be exactly 6 characters. It isn't clear if you want one or both variables to have the length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If numeric you may have to provide examples as approaches will vary whether decimal values might be present.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 18:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642374#M191609</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-23T18:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642377#M191611</link>
      <description>&lt;P&gt;The variables&amp;nbsp;are numeric.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 18:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642377#M191611</guid>
      <dc:creator>Jssa8423</dc:creator>
      <dc:date>2020-04-23T18:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642378#M191612</link>
      <description>&lt;P&gt;lower_soc_code=13201101 upper_soc_code=13201101&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and some have six digits lower_soc_code=13211100 upper_soc_code=13211100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, I'd like to filter and remove any lower_code_soc and upper_soc_code where the last two digits do not equal 0&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 19:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642378#M191612</guid>
      <dc:creator>Jssa8423</dc:creator>
      <dc:date>2020-04-23T19:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642383#M191614</link>
      <description>&lt;P&gt;The last two digits of an integer is just the result of taking MOD 100.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (mod(&lt;SPAN&gt;lower_code_soc,100) ne 0) or  (mod(upper_soc_code,100)&amp;nbsp;ne&amp;nbsp;0)&amp;nbsp;then&amp;nbsp;delete;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2020 19:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642383#M191614</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-23T19:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642388#M191619</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185922"&gt;@Jssa8423&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;lower_soc_code=13201101 upper_soc_code=13201101&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and some have six digits lower_soc_code=13211100 upper_soc_code=13211100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, I'd like to filter and remove any lower_code_soc and upper_soc_code where the last two digits do not equal 0&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So which is it, 6 digits OR last two digits?&lt;/P&gt;
&lt;P&gt;And do you want to remove records containing such values (filter) or replace the value with a missing value (or something else)?&lt;/P&gt;
&lt;P&gt;And everything you show has 8 digits. So please show examples of each type of start value and what the desired result for the data should be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a numeric value you can get the numeric value of the last 2 digits IF is an integer with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;last2 = mod(variable,100);&lt;/P&gt;
&lt;P&gt;So if Last2 = 0 the last two digits were 00. If you want to replace the value of the variable you could do something like:&lt;/P&gt;
&lt;P&gt;IF Mod(variable,100) = 0 then &amp;lt;what you want goes here&amp;gt;. Delete would remove the record. "then variable=. ;"&lt;/P&gt;
&lt;P&gt;would set the value to missing.&lt;/P&gt;
&lt;P&gt;But that doesn't care about the "length" of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint for the future: If a variable, especially a code of some sort, that is not going to be used in arithmetic it should be character.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 19:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642388#M191619</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-23T19:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642389#M191620</link>
      <description>&lt;P&gt;Thank you, I appreciate it.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 19:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642389#M191620</guid>
      <dc:creator>Jssa8423</dc:creator>
      <dc:date>2020-04-23T19:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642390#M191621</link>
      <description>Thank you.</description>
      <pubDate>Thu, 23 Apr 2020 19:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642390#M191621</guid>
      <dc:creator>Jssa8423</dc:creator>
      <dc:date>2020-04-23T19:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642392#M191622</link>
      <description>&lt;P&gt;If you entered SS numbers as numbers then you need to watch out for LEADING zeros.&lt;/P&gt;
&lt;P&gt;To convert/display the numbers as 9 digit strings with leading zeros use the Z format.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 19:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642392#M191622</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-23T19:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to filter data show that it only shows me variables with six digits only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642393#M191623</link>
      <description>Can you try&lt;BR /&gt;where (low_soc_code/1000000) &amp;lt; 1 AND (upper_soc_code/1000000) &amp;lt; 1</description>
      <pubDate>Thu, 23 Apr 2020 19:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-filter-data-show-that-it-only-shows-me-variables-with/m-p/642393#M191623</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2020-04-23T19:54:16Z</dc:date>
    </item>
  </channel>
</rss>

