<?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 do I debug an infinite running proc survey select? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/577968#M163859</link>
    <description>&lt;P&gt;Thanks for the help. Yeah, it turned out I terminated it too soon. It seems the run time goes up non-linearly with the size of the strata. I was able to get the code dialed in on the small states, before doing an overnight run on the larger states.&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2019 07:18:29 GMT</pubDate>
    <dc:creator>jamesf</dc:creator>
    <dc:date>2019-07-31T07:18:29Z</dc:date>
    <item>
      <title>How do I debug an infinite running proc survey select?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/575187#M162640</link>
      <description>&lt;P&gt;I am trying to do a PPS&amp;nbsp;proc survey select on a large number of records (~10 million) and am running into never-ending task runs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code works when I limit the input to particular sub-samples, but goes into a never-ending task on other sub-samples, which requires a full SAS reset. I am unsure how to get any debugging information from cases with&amp;nbsp;never-ending tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I limit my input data to state 3 (200,000 units, 9,000 selections,&amp;nbsp;58 second&amp;nbsp;run time). If I limit my input data to state 1(2,500,000 units, 140,000 selections), the code runs forever (3+ hours) until I force terminate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance&amp;nbsp;as to how to start narrowing down the cause would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My&amp;nbsp;data&amp;nbsp;is of the form&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Data set: nh_p_stra&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;STATE SampleSize&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;1 2000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;2 3000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;3 4000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Data set: data_in&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Unit_id STATE weight&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;0000001 1 1.2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;0000002 1 2.1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;0000003 1 0.9&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;0000004 2 0.8&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;0000005 2 1.3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is of the form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;surveyselect&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;method&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=pps &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=data_in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;sampsize&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=nh_p_stra &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=selection_out &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;seed&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;123&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;strata&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; state;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;id&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;unit_id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;size&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; weight;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2019 09:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/575187#M162640</guid>
      <dc:creator>jamesf</dc:creator>
      <dc:date>2019-07-21T09:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I debug an infinite running proc survey select?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/575418#M162759</link>
      <description>&lt;P&gt;I suspect that you are just terminating a tad too soon. Depending on how you did that the output set should have been populated, how far did you get?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or run a loop selecting each state at a time, generating a separate output set then combine the results&amp;nbsp;later.&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   length str $ 100.;
   do state= 1 to 50;
      call execute('proc surveyselect method=pps data=data_in sampsize=nh_p_stra');
      str=catt('(where=(state=',state,')) out=selection',state,'seed=123;');
      call execute (str);
      call execute('strata state;
         id unit_id;
         size weight;
         run;');
   end;
run;&lt;/PRE&gt;
&lt;P&gt;I suspect the issue is just the size of your data set, as in numbers of records and possibly the values of your weight variable. There are going to be a lot of calculations, for instance the sum of weight per strata as a start, then calculate the proportion&amp;nbsp; of that total each record represents. If you haven't read the documentation details on calculation PPS samples you may not realize the scope of computations involved in a data set this big&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 15:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/575418#M162759</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-22T15:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I debug an infinite running proc survey select?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/575609#M162859</link>
      <description>&lt;P&gt;One factor to check is system options and resources. The METHOD=PPS&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_surveyselect_details13.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_self"&gt;alogorithm&lt;/A&gt; involves sorting. And sorting can become slow when system resources get low.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, consider whether a different selection method might be appropriate for the task. Some other types of PPS selection are generally faster -- e.g, systematic, sequential, with-replacement. In addition to equal-probability methods. (Doc is&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_surveyselect_syntax01.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug.surveyselect.selectmethod" target="_self"&gt;here&lt;/A&gt;.)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another possibility is to make the strata smaller (by using additional stratification, or by simply subdividing them).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 22:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/575609#M162859</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2019-07-22T22:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I debug an infinite running proc survey select?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/577968#M163859</link>
      <description>&lt;P&gt;Thanks for the help. Yeah, it turned out I terminated it too soon. It seems the run time goes up non-linearly with the size of the strata. I was able to get the code dialed in on the small states, before doing an overnight run on the larger states.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 07:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-debug-an-infinite-running-proc-survey-select/m-p/577968#M163859</guid>
      <dc:creator>jamesf</dc:creator>
      <dc:date>2019-07-31T07:18:29Z</dc:date>
    </item>
  </channel>
</rss>

