<?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 percentile allocation of observation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209230#M267293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two datasets;&lt;/P&gt;&lt;P&gt;1. Policy dataset where it has Policy_No and its Branch_code details;&lt;/P&gt;&lt;P&gt;2. Employee dataset where it has Branch_code, Employee_ID and Percentage field;&lt;/P&gt;&lt;P&gt;data Policy;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; input Policy_No Branch $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;101 A001&lt;/P&gt;&lt;P&gt;102 A001&lt;/P&gt;&lt;P&gt;103 A001&lt;/P&gt;&lt;P&gt;104 A001&lt;/P&gt;&lt;P&gt;105 A001&lt;/P&gt;&lt;P&gt;106 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;107 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;108 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;109 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;110 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;111 A001&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;112 A001&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Employee;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; input Branch $ Emp_ID Percent;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A001 1111 30&lt;/P&gt;&lt;P&gt;A001 2222 50&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a output where 30% of policy details (any 4 policy_no out of total 12 policies) should be allocated to emp_ID 1111 and 50%&lt;SPAN style="font-size: 13.3333330154419px;"&gt;(any 6 policy_no out of total 12 polices)&lt;/SPAN&gt; of policy allocated to emp_ID 2222&lt;/P&gt;&lt;P&gt;desired output will be like this:&lt;/P&gt;&lt;P&gt;Branch Emp_ID Policy_no&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 101&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 102&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 103&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 104&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;A001 2222 105&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A001 2222 106&lt;/P&gt;&lt;P&gt;A001 2222 107&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;A001 2222 108&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 2222 109&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 2222 110&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Regards&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Ash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2015 14:56:48 GMT</pubDate>
    <dc:creator>Ashraya</dc:creator>
    <dc:date>2015-06-18T14:56:48Z</dc:date>
    <item>
      <title>percentile allocation of observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209230#M267293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two datasets;&lt;/P&gt;&lt;P&gt;1. Policy dataset where it has Policy_No and its Branch_code details;&lt;/P&gt;&lt;P&gt;2. Employee dataset where it has Branch_code, Employee_ID and Percentage field;&lt;/P&gt;&lt;P&gt;data Policy;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; input Policy_No Branch $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;101 A001&lt;/P&gt;&lt;P&gt;102 A001&lt;/P&gt;&lt;P&gt;103 A001&lt;/P&gt;&lt;P&gt;104 A001&lt;/P&gt;&lt;P&gt;105 A001&lt;/P&gt;&lt;P&gt;106 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;107 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;108 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;109 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;110 A001&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;111 A001&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;112 A001&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Employee;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; input Branch $ Emp_ID Percent;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A001 1111 30&lt;/P&gt;&lt;P&gt;A001 2222 50&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a output where 30% of policy details (any 4 policy_no out of total 12 policies) should be allocated to emp_ID 1111 and 50%&lt;SPAN style="font-size: 13.3333330154419px;"&gt;(any 6 policy_no out of total 12 polices)&lt;/SPAN&gt; of policy allocated to emp_ID 2222&lt;/P&gt;&lt;P&gt;desired output will be like this:&lt;/P&gt;&lt;P&gt;Branch Emp_ID Policy_no&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 101&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 102&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 103&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 1111 104&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;A001 2222 105&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A001 2222 106&lt;/P&gt;&lt;P&gt;A001 2222 107&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;A001 2222 108&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 2222 109&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;A001 2222 110&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Regards&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Ash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 14:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209230#M267293</guid>
      <dc:creator>Ashraya</dc:creator>
      <dc:date>2015-06-18T14:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: percentile allocation of observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209231#M267294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way to do this is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data Policy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input Policy_No Branch $;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;101 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;102 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;103 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;104 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;105 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;106 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;107 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;108 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;109 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;110 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;111 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;112 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data Employee;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input Branch $ Emp_ID Percent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A001 1111 30&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A001 2222 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=policy; by branch policy_no; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=employee; by branch emp_id; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data polOrd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set policy; by branch;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.branch then ord = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ord + 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data empCum;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set employee; by branch;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.branch then fromPct = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fromPct + percent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table want as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select p.branch, emp_id, policy_no&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from empCum as e inner join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; polOrd as p on e.branch=p.branch&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;group by p.branch, emp_id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;having &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ord &amp;gt; round(fromPct/100*count(ord)) and &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ord &amp;lt;= round((fromPct+percent)/100*count(ord))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;order by branch, emp_id, policy_no;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 16:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209231#M267294</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-06-18T16:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: percentile allocation of observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209232#M267295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG style="font-size: 11.6999998092651px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1153" data-externalid="" data-presence="null" data-userid="2746" data-username="PGStats" href="https://communities.sas.com/people/PGStats" id="jive-274650032820944080186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;PGStats&lt;/A&gt;&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replay, it worked,&lt;/P&gt;&lt;P&gt;I wonder is any other method or by using macro can we achieve the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 18:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209232#M267295</guid>
      <dc:creator>Ashraya</dc:creator>
      <dc:date>2015-06-18T18:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: percentile allocation of observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209233#M267296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I imagine an alternate solution could be based on proc surveyselect. I can't however think of any use for macro processing to solve this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 20:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209233#M267296</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-06-18T20:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: percentile allocation of observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209234#M267297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above solution by PGStats will allocate sequence of policy no. What if it require to allocate the random policy_no instead of a series allocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 01:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209234#M267297</guid>
      <dc:creator>Ashraya</dc:creator>
      <dc:date>2015-06-19T01:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: percentile allocation of observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209235#M267298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply randomize the &lt;STRONG&gt;policy_no&lt;/STRONG&gt; order before the selection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data Policy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input Policy_No Branch $;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;101 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;102 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;103 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;104 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;105 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;106 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;107 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;108 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;109 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;110 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;111 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;112 A001&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data Employee;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input Branch $ Emp_ID Percent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A001 1111 30&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A001 2222 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data polOrd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set policy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ord = rand("UNIFORM");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=polOrd; by branch ord; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=employee; by branch emp_id; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc rank data=polOrd out=polOrd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;by branch;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var ord;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data empCum;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set employee; by branch;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.branch then fromPct = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fromPct + percent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table want as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select p.branch, emp_id, policy_no&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from empCum as e inner join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; polOrd as p on e.branch=p.branch&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;group by p.branch, emp_id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;having &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ord &amp;gt; round(fromPct/100*count(ord)) and &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ord &amp;lt;= round((fromPct+percent)/100*count(ord))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;order by branch, emp_id, policy_no;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 15:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentile-allocation-of-observation/m-p/209235#M267298</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-06-19T15:57:09Z</dc:date>
    </item>
  </channel>
</rss>

