<?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 proc surveyselect for random sample of claims detail in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47664#M2090</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is just a simple random sample of size N, I wouldn't use surveyselect.&amp;nbsp; I.e., if you know how many claims are in the tables, I would just use one of the random number functions (e.g., randnor) with seed 0 and forcing the result to be an integer value from, say, 1 to the number of claims) and sequentially assign the numbers as your read each claim.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the claim is assigned a pseudo random number &amp;lt;= N then parse and retrieve the record on the fly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way you could do it all in one pass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Aug 2011 21:56:29 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-08-12T21:56:29Z</dc:date>
    <item>
      <title>proc surveyselect for random sample of claims detail</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47663#M2089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a large (like 1 billion+ obs) table (actually many quarterly tables) of claims (header (unique claim number) and detail(1-n supporting lines for the unique claim number) combined, ie, 1 header + 5 detail lines yields 5 combined lines).&amp;nbsp; We have been asked to provide a random sample of claims data from this source.&amp;nbsp; This means that I need to provide all detail lines for a randomly selected claim.&amp;nbsp; Is it possible for proc surveyselect to do this in a single pass or do I need to take the sample and go back against the source and retrieve the rest of the lines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 19:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47663#M2089</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2011-08-12T19:32:26Z</dc:date>
    </item>
    <item>
      <title>proc surveyselect for random sample of claims detail</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47664#M2090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is just a simple random sample of size N, I wouldn't use surveyselect.&amp;nbsp; I.e., if you know how many claims are in the tables, I would just use one of the random number functions (e.g., randnor) with seed 0 and forcing the result to be an integer value from, say, 1 to the number of claims) and sequentially assign the numbers as your read each claim.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the claim is assigned a pseudo random number &amp;lt;= N then parse and retrieve the record on the fly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way you could do it all in one pass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 21:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47664#M2090</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-12T21:56:29Z</dc:date>
    </item>
    <item>
      <title>proc surveyselect for random sample of claims detail</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47665#M2091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you do not post some sample data, It is hard to code.&lt;/P&gt;&lt;P&gt;And i think it is possible for proc surveyselect to do this in a single pass.But I need time &lt;/P&gt;&lt;P&gt;to check documentation.&lt;/P&gt;&lt;P&gt;The following is an example, If you would like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;proc sort data=sashelp.class out=temp(keep=age) nodupkey;
 by age;
run;
proc sort data=sashelp.class;by age;run;
proc surveyselect data=temp method=srs rate=.5 out=sample;run;
data want;
 merge sashelp.class sample(in=in_two);
 by age;
 if in_two;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 05:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-surveyselect-for-random-sample-of-claims-detail/m-p/47665#M2091</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-08-16T05:18:19Z</dc:date>
    </item>
  </channel>
</rss>

