<?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: what is the process to group the observations in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163006#M42307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have provided code above which covers your request to "group the observations based on some value here the value is 1000000".&amp;nbsp; Without further information, test data in, required output, and clarification of what the logic actually is, I don't see how further code can be provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Feb 2015 08:54:41 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-02-12T08:54:41Z</dc:date>
    <item>
      <title>what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/162999#M42300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have data set contain the variables emp_id, and salaries.&lt;/P&gt;&lt;P&gt;assume there will be 2000 records. emp_id are different and salaries are changed based upon their positions. salaries are min 10000 and maximum 500000.&lt;/P&gt;&lt;P&gt;devide this salaries into 10 groups then each group contain the salaries of 1000000. i.e. if the first ten members salary is equals to 10 lakhs then we want the output as.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt;sum of value&lt;/SPAN&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(persons)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;1000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;note:we don't take salaries between 1 and 10 lakh. we need the sum of persons salaries sum equals to 10 lakh.&lt;/P&gt;&lt;P&gt;in the second observation also same. The first case who are considered in the second record those persons are not considered. There are remaining of who we are considered in first observation.&lt;/P&gt;&lt;P&gt;like 10 groups we need. how this process is done in sas.&lt;/P&gt;&lt;P&gt;if you know please comment..&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 12:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/162999#M42300</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-02-11T12:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163000#M42301</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;Perhaps some test data/required output would make your request clearer as I don't quite follow why you get two results?&amp;nbsp; As for grouping, well, you can use datastep with by group processing, proc means/summary/freq.&amp;nbsp; The way I tend to do grouping is:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SALARY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT(distinct PERSON) as COUNT_PERSON&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by SALARY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SALARY=100000;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 13:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163000#M42301</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-11T13:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163001#M42302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its not group by salary. the salaries are different manner in this data. &lt;/P&gt;&lt;P&gt;if the sum of 20 persons is 1000000 then those are in one group.&lt;/P&gt;&lt;P&gt;and the remaining persons salaries equals to 100000 then those are second group. the first group persons are not included in second group.&lt;/P&gt;&lt;P&gt;like wise all the persons are covered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163001#M42302</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-02-11T18:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163002#M42303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the order of the original data of any importance to this process?&lt;/P&gt;&lt;P&gt;Is the 100000 group total: 1) exactly 1000000, 2) less than or equal to 1000000 but within a fixed difference (such as 999785 is within 500 of 1000000), 3) within some fixed amount of 100000, plus or minus some value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if after grouping to 1000000 you don't have 10 groups?&lt;/P&gt;&lt;P&gt;Is there a minimum number of people that must be in each group? A maximum?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to provide some data to show what this means:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;we don't take salaries between 1 and 10 lakh. we need the sum of persons salaries sum equals to 10 lakh.&lt;/P&gt;
&lt;P&gt;in the second observation also same. The first case who are considered in the second record those persons are not considered. There are remaining of who we are considered in first observation.&lt;/P&gt;
&lt;P&gt;like 10 groups we need. how this process is done in sas.&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163002#M42303</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-02-11T18:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163003#M42304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have SAS/OR, then check out &lt;A href="http://support.sas.com/documentation/cdl/en/ormpug/63975/HTML/default/viewer.htm#ormpug_optmodel_sect001.htm" title="http://support.sas.com/documentation/cdl/en/ormpug/63975/HTML/default/viewer.htm#ormpug_optmodel_sect001.htm"&gt;SAS/OR(R) 9.3 User's Guide: Mathematical Programming&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you don't, you probably need data step/array loop.&amp;nbsp; Either way you want to provide some mocked data for people to work on if you need specific SAS code instead of general guidance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163003#M42304</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-02-11T18:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163004#M42305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes there is a lot of importance . its not exactly 10 lakh. its near to 10 lakh and also more than 10 lakh also but not exceeding . means below 10 lakh&amp;nbsp; ok and above also ok.&amp;nbsp; after grouping i need count of employees. This is for analysis purpose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 19:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163004#M42305</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-02-11T19:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163005#M42306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if any one know the answer please post how to by group the observations based on some value&lt;/P&gt;&lt;P&gt;here the value is 1000000. the sum of the employee salaries equals to 10 lakh. then &lt;/P&gt;&lt;P&gt;displays 10lakh&amp;nbsp; count(no of employes)&lt;/P&gt;&lt;P&gt;like wise the total data is covered. Based on 10 lakh i need groups its not between the 10 lakh its the sum of all the persons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 05:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163005#M42306</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2015-02-12T05:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163006#M42307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have provided code above which covers your request to "group the observations based on some value here the value is 1000000".&amp;nbsp; Without further information, test data in, required output, and clarification of what the logic actually is, I don't see how further code can be provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 08:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163006#M42307</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-12T08:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: what is the process to group the observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163007#M42308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;post your sample data , and the output . You should know there might not be exactly be "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; the sum of persons salaries sum equals to 10 lakh" . if their salary is different .&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 09:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-is-the-process-to-group-the-observations/m-p/163007#M42308</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-12T09:07:02Z</dc:date>
    </item>
  </channel>
</rss>

