<?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: How to get a 10% of the population for each state in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55656#M11843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Hi,&lt;/P&gt;&lt;P dir="ltr"&gt;I have a business scenario where I have to select only 10% of the total observations for each state. for ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="454"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-right: black 0.5pt solid; border-top: black 0.5pt solid; font-weight: bold; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 1pt solid; font-family: Calibri;" width="73"&gt;State&lt;/TD&gt;&lt;TD class="xl63" style="border-right: black 0.5pt solid; border-top: black 0.5pt solid; font-weight: bold; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 1pt solid; font-family: Calibri;" width="134"&gt;total observations&lt;/TD&gt;&lt;TD class="xl63" style="border-right: black 0.5pt solid; border-top: black 0.5pt solid; font-weight: bold; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 1pt solid; font-family: Calibri;" width="247"&gt;No of obs to be output (10% of total)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;Northeast&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;43543&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;4355&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;Northwest&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;12323&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;1233&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;Southeast&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;876578&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;87658&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;Southwest&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;387482&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;38749&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The final output should have 10 % of the population from each state. Please assist me with the code. I tried using Proc SurveySelect but did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Feb 2012 15:17:06 GMT</pubDate>
    <dc:creator>Cherry</dc:creator>
    <dc:date>2012-02-16T15:17:06Z</dc:date>
    <item>
      <title>How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55654#M11841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;I have a business scenario where I have to select only 10% of the total observations for each state. for ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P&gt;The final output should have 10 % of the population from each state. Please assist me with the code. I tried using Proc SurveySelect but did not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 13:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55654#M11841</guid>
      <dc:creator>Cherry</dc:creator>
      <dc:date>2012-02-16T13:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55655#M11842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would have to share more details about your problems, such as your code and the log involved. As it seems to me, proc surveyselect works as being expected. Please see the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp.class out=have;&lt;/P&gt;&lt;P&gt;by sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SurveySelect data=have out=want samprate=0.1;&lt;/P&gt;&lt;P&gt;strata sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure any special method or algorithm&amp;nbsp; you are applying will make a difference, so more details will be needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 14:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55655#M11842</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-02-16T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55656#M11843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Hi,&lt;/P&gt;&lt;P dir="ltr"&gt;I have a business scenario where I have to select only 10% of the total observations for each state. for ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="454"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-right: black 0.5pt solid; border-top: black 0.5pt solid; font-weight: bold; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 1pt solid; font-family: Calibri;" width="73"&gt;State&lt;/TD&gt;&lt;TD class="xl63" style="border-right: black 0.5pt solid; border-top: black 0.5pt solid; font-weight: bold; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 1pt solid; font-family: Calibri;" width="134"&gt;total observations&lt;/TD&gt;&lt;TD class="xl63" style="border-right: black 0.5pt solid; border-top: black 0.5pt solid; font-weight: bold; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 1pt solid; font-family: Calibri;" width="247"&gt;No of obs to be output (10% of total)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;Northeast&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;43543&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;4355&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;Northwest&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;12323&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;1233&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;Southeast&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;876578&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri; background-color: #d8d8d8;"&gt;87658&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: black 0.5pt solid; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;Southwest&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;387482&lt;/TD&gt;&lt;TD align="right" style="border-right: black 0.5pt solid; border-top: medium none; font-weight: 400; font-size: 11pt; border-left: medium none; color: black; border-bottom: black 0.5pt solid; font-family: Calibri;"&gt;38749&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Helv;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The final output should have 10 % of the population from each state. Please assist me with the code. I tried using Proc SurveySelect but did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 15:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55656#M11843</guid>
      <dc:creator>Cherry</dc:creator>
      <dc:date>2012-02-16T15:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55657#M11844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only want approximately 10% then just use a random number generator to give each obs 10% chance of being selected.&lt;/P&gt;&lt;P&gt;&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 ranuni(0) &amp;lt;= .10 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SurveySelect should work for this problem.&amp;nbsp; Could you post the code you tried?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 15:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55657#M11844</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-16T15:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55658#M11845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff;"&gt;Did you try the code proposed by Hai.Kuo?&amp;nbsp; Seems like it should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;proc sort data=yourdatafilelibandname out=have;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; by state;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;Proc SurveySelect data=have out=want samprate=0.1;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; strata state;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 15:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55658#M11845</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-16T15:26:43Z</dc:date>
    </item>
    <item>
      <title>How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55659#M11846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following will not take a random sample but it will return every nth record from each by group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; create view class as&lt;/P&gt;&lt;P&gt; select * &lt;/P&gt;&lt;P&gt; from sashelp.cars &lt;/P&gt;&lt;P&gt; order by origin;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set class;&lt;/P&gt;&lt;P&gt; by origin;&lt;/P&gt;&lt;P&gt; array accum&amp;amp;sysindex[1] _temporary_; *temp so no need to drop later;&lt;/P&gt;&lt;P&gt; if first.origin then accum&amp;amp;sysindex[1]=10;&lt;/P&gt;&lt;P&gt; accum&amp;amp;sysindex[1]+1;&lt;/P&gt;&lt;P&gt; if accum&amp;amp;sysindex[1]&amp;gt;10 then&lt;/P&gt;&lt;P&gt;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; accum&amp;amp;sysindex[1]=accum&amp;amp;sysindex[1]-10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; select a.origin,total,output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from (select origin,count(1) as total from sashelp.cars group by origin) a&lt;/P&gt;&lt;P&gt;&amp;nbsp; left join (select origin,count(1) as output from want group by origin) b on a.origin=b.origin;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="center"&gt;&lt;/P&gt;&lt;TABLE cellspacing="0" class="Table"&gt;&lt;THEAD&gt;&lt;TR&gt;&lt;TH class="Header" scope="colgroup" style="vertical-align: bottom; text-align: left;"&gt;Origin&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="vertical-align: bottom; text-align: right;"&gt;total&lt;/TH&gt;&lt;TH class="Header" scope="colgroup" style="vertical-align: bottom; text-align: right;"&gt;output&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: left;"&gt;Asia&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;158&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: left;"&gt;Europe&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;123&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: left;"&gt;USA&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;147&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 17:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55659#M11846</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-02-16T17:33:49Z</dc:date>
    </item>
    <item>
      <title>How to get a 10% of the population for each state</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55660#M11847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Cherry wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helv; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Hi,&lt;/P&gt;&lt;P dir="ltr"&gt;I have a business scenario where I have to select only 10% of the total observations for each state. for ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="454"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-bottom: black 1pt solid; border-left: black 0.5pt solid; font-family: Calibri; color: black; font-size: 11pt; border-top: black 0.5pt solid; font-weight: bold; border-right: black 0.5pt solid;" width="73"&gt;State&lt;/TD&gt;&lt;TD class="xl63" style="border-bottom: black 1pt solid; border-left: medium none; font-family: Calibri; color: black; font-size: 11pt; border-top: black 0.5pt solid; font-weight: bold; border-right: black 0.5pt solid;" width="134"&gt;total observations&lt;/TD&gt;&lt;TD class="xl63" style="border-bottom: black 1pt solid; border-left: medium none; font-family: Calibri; color: black; font-size: 11pt; border-top: black 0.5pt solid; font-weight: bold; border-right: black 0.5pt solid;" width="247"&gt;No of obs to be output (10% of total)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-bottom: black 0.5pt solid; border-left: black 0.5pt solid; background-color: #d8d8d8; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;Northeast&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; background-color: #d8d8d8; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;43543&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; background-color: #d8d8d8; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;4355&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-bottom: black 0.5pt solid; border-left: black 0.5pt solid; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;Northwest&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;12323&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;1233&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-bottom: black 0.5pt solid; border-left: black 0.5pt solid; background-color: #d8d8d8; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;Southeast&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; background-color: #d8d8d8; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;876578&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; background-color: #d8d8d8; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;87658&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border-bottom: black 0.5pt solid; border-left: black 0.5pt solid; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;Southwest&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;387482&lt;/TD&gt;&lt;TD align="right" style="border-bottom: black 0.5pt solid; border-left: medium none; font-family: Calibri; color: black; font-size: 11pt; border-top: medium none; font-weight: 400; border-right: black 0.5pt solid;"&gt;38749&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Helv; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The final output should have 10 % of the population from each state. Please assist me with the code. I tried using Proc SurveySelect but did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt; &lt;P&gt;&lt;/P&gt; &lt;/PRE&gt;&lt;P&gt;HOW did it not work? No output at all? Expected number of observations not selected? What did your code look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 15:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-a-10-of-the-population-for-each-state/m-p/55660#M11847</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-02-17T15:13:55Z</dc:date>
    </item>
  </channel>
</rss>

