<?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: Subsetting data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395988#M278079</link>
    <description>&lt;P&gt;In a data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if variablename in (. 0 99999999 888888888) then &amp;lt;do what ever&amp;gt;.&lt;/P&gt;
&lt;P&gt;If you are actually creating a subset data with these values then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if variablename in (. 0 99999999 888888888);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to exclude:&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if variablename not&amp;nbsp;in (. 0 99999999 888888888);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or use a dataset option where clause (where=(&amp;nbsp;variablename not&amp;nbsp;in (. 0 99999999 888888888))) if you don't want to create a separate data set but use the same data set for analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Sep 2017 15:43:06 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-09-14T15:43:06Z</dc:date>
    <item>
      <title>Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395932#M278074</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to subset observations that are 9 digits and in AAA-SS-XXXX format (e.g. 132980984). I found some variations including values that are fewer than 9 digits, missing (.), 0, and some values that doesn't have any posted meaning (e.g. 999999999 or 888888888) So far, I am considering anything except AAA-SS-XXXX as being unknown. Can someone help me figure out how to do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395932#M278074</guid>
      <dc:creator>Kiko</dc:creator>
      <dc:date>2017-09-14T14:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395938#M278075</link>
      <description>&lt;P&gt;What do you have so far?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you looking for help with a regular expression or using BASE SAS functions?&lt;/P&gt;
&lt;P&gt;Regular Expressions is likely faster, but it's not easy to understand or modify.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:44:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395938#M278075</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-14T14:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395944#M278076</link>
      <description>&lt;P&gt;Please clarify what this means:&lt;/P&gt;
&lt;P&gt;I am trying to subset observations that are 9 digits and in AAA-SS-XXXX format (e.g. 132980984).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would expect the example to look like 132-98-0984 from your "format" comment. By anychance has the SSN format been assigned to this variable?&lt;/P&gt;
&lt;P&gt;Is this variable character or numeric? Your statement of values of . implies numeric but I've been fooled before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might post some example values and what you want as a result for those.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If some values are out of expected ranges such as your 999999999 then you should provide expected ranges.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395944#M278076</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-14T14:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395974#M278077</link>
      <description>&lt;P&gt;Hello-&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the confusion- yes, they are SSN and it is numeric. Here are a few examples:&amp;nbsp;&lt;/P&gt;&lt;P&gt;209876896&lt;/P&gt;&lt;P&gt;498304981&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;54376548&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;4326583&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically want to grab every observation that is 9 digits thus exclude the followings:&amp;nbsp;&lt;/P&gt;&lt;P&gt;0 / '.'/ 999999999/ 888888888&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also found a few cases that are 9 digits, but start with 888 which I am not sure how to deal with, but would like to include them for now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395974#M278077</guid>
      <dc:creator>Kiko</dc:creator>
      <dc:date>2017-09-14T15:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395983#M278078</link>
      <description>Search LexJansen.com for example macros/code:&lt;BR /&gt;&lt;A href="http://analytics.ncsu.edu/sesug/2007/PO23.pdf" target="_blank"&gt;http://analytics.ncsu.edu/sesug/2007/PO23.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395983#M278078</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-14T15:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395988#M278079</link>
      <description>&lt;P&gt;In a data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if variablename in (. 0 99999999 888888888) then &amp;lt;do what ever&amp;gt;.&lt;/P&gt;
&lt;P&gt;If you are actually creating a subset data with these values then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if variablename in (. 0 99999999 888888888);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to exclude:&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if variablename not&amp;nbsp;in (. 0 99999999 888888888);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or use a dataset option where clause (where=(&amp;nbsp;variablename not&amp;nbsp;in (. 0 99999999 888888888))) if you don't want to create a separate data set but use the same data set for analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395988#M278079</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-14T15:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395989#M278080</link>
      <description>&lt;P&gt;Thank you both! super helpful&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data/m-p/395989#M278080</guid>
      <dc:creator>Kiko</dc:creator>
      <dc:date>2017-09-14T15:44:46Z</dc:date>
    </item>
  </channel>
</rss>

