<?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 select observation based on a column's number format (PROC SQL) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13811#M2050</link>
    <description>In the data set, there are unique observations, identified by a number in the ID column.  Some observations are subsets of a main one, and they are designated with a decimal.  (The column format is BEST12. and the length is 8).&lt;BR /&gt;
&lt;BR /&gt;
A schematic of the data set looks like:&lt;BR /&gt;
&lt;BR /&gt;
ID   Data1 Data2 Data3&lt;BR /&gt;
1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
3.1&lt;BR /&gt;
4&lt;BR /&gt;
5&lt;BR /&gt;
6&lt;BR /&gt;
6.1&lt;BR /&gt;
6.2&lt;BR /&gt;
6.3&lt;BR /&gt;
7&lt;BR /&gt;
8 &lt;BR /&gt;
9&lt;BR /&gt;
10&lt;BR /&gt;
10.1&lt;BR /&gt;
10.2&lt;BR /&gt;
&lt;BR /&gt;
I want to run a PROC SQL statement to count certain observations, but I don't want to include any of the "child" observations (i.e. I only want to select those in the column that are whole numbers; none that have decimal places).  &lt;BR /&gt;
&lt;BR /&gt;
I'm not sure how to write a general statement to do this.  How do I indicate to not include anything from the ID column that has a decimal point (or a number after the decimal)?  I can't call for only integers, given that it's a decimal column, right?  &lt;BR /&gt;
&lt;BR /&gt;
Any insight would be greatly appreciated.</description>
    <pubDate>Mon, 21 Feb 2011 03:49:51 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-02-21T03:49:51Z</dc:date>
    <item>
      <title>How to select observation based on a column's number format (PROC SQL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13811#M2050</link>
      <description>In the data set, there are unique observations, identified by a number in the ID column.  Some observations are subsets of a main one, and they are designated with a decimal.  (The column format is BEST12. and the length is 8).&lt;BR /&gt;
&lt;BR /&gt;
A schematic of the data set looks like:&lt;BR /&gt;
&lt;BR /&gt;
ID   Data1 Data2 Data3&lt;BR /&gt;
1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
3.1&lt;BR /&gt;
4&lt;BR /&gt;
5&lt;BR /&gt;
6&lt;BR /&gt;
6.1&lt;BR /&gt;
6.2&lt;BR /&gt;
6.3&lt;BR /&gt;
7&lt;BR /&gt;
8 &lt;BR /&gt;
9&lt;BR /&gt;
10&lt;BR /&gt;
10.1&lt;BR /&gt;
10.2&lt;BR /&gt;
&lt;BR /&gt;
I want to run a PROC SQL statement to count certain observations, but I don't want to include any of the "child" observations (i.e. I only want to select those in the column that are whole numbers; none that have decimal places).  &lt;BR /&gt;
&lt;BR /&gt;
I'm not sure how to write a general statement to do this.  How do I indicate to not include anything from the ID column that has a decimal point (or a number after the decimal)?  I can't call for only integers, given that it's a decimal column, right?  &lt;BR /&gt;
&lt;BR /&gt;
Any insight would be greatly appreciated.</description>
      <pubDate>Mon, 21 Feb 2011 03:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13811#M2050</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-21T03:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to select observation based on a column's number format (PROC SQL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13812#M2051</link>
      <description>Please specify: would you drop an observation having a value of 5.0 ?&lt;BR /&gt;
If not then just compare the value to its integer value (using function int() for example) and drop if unequal.</description>
      <pubDate>Mon, 21 Feb 2011 07:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13812#M2051</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2011-02-21T07:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to select observation based on a column's number format (PROC SQL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13813#M2052</link>
      <description>Of course!  That's a great solution.  Thanks for suggesting it.</description>
      <pubDate>Mon, 21 Feb 2011 20:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13813#M2052</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-21T20:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to select observation based on a column's number format (PROC SQL)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13814#M2053</link>
      <description>are you able to filter like&lt;BR /&gt;
where mod( ID,1 ) = 0&lt;BR /&gt;
the MOD() function provides the "remainder" after "dividing" ID by the second parameter, so will return 0 when ID is an integer.  &lt;BR /&gt;
Here is a test on the syntax [pre]650  proc sql FEEDBACK ;&lt;BR /&gt;
651  create table ints as select * from sashelp.class where mod(age,1) = 0;&lt;BR /&gt;
NOTE: Statement transforms to:&lt;BR /&gt;
&lt;BR /&gt;
        select CLASS.Name, CLASS.Sex, CLASS.Age, CLASS.Height, CLASS.Weight&lt;BR /&gt;
          from SASHELP.CLASS&lt;BR /&gt;
         where MOD(CLASS.Age, 1) = 0;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Table WORK.INTS created, with 19 rows and 5 columns.&lt;BR /&gt;
&lt;BR /&gt;
652  create table nint as select * from sashelp.class where mod(age,1) ne 0;&lt;BR /&gt;
NOTE: Statement transforms to:&lt;BR /&gt;
&lt;BR /&gt;
        select CLASS.Name, CLASS.Sex, CLASS.Age, CLASS.Height, CLASS.Weight&lt;BR /&gt;
          from SASHELP.CLASS&lt;BR /&gt;
         where MOD(CLASS.Age, 1) not = 0;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Table WORK.NINT created, with 0 rows and 5 columns.&lt;BR /&gt;
&lt;BR /&gt;
653  quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used[/pre]&lt;BR /&gt;
looks like what you need</description>
      <pubDate>Wed, 23 Feb 2011 17:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-observation-based-on-a-column-s-number-format-PROC/m-p/13814#M2053</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-23T17:09:32Z</dc:date>
    </item>
  </channel>
</rss>

