<?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 Dynamic sampsize in proc surveyselect in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241864#M55742</link>
    <description>&lt;P&gt;I am using proc surveyselect for unrestricted random sampling, my code is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc surveyselect data=A out=B
     seed = 1234 method = urs
	 sampsize=237 /* This is the number of rows of a dataset called C, which has already been created*/
     outhits rep = 1;
run;
ods listing close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My input datafile is called A and output datafile is called B.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have another dataset called C (which is different from the input file A) and it has 237 rows, i.e., 237 observations for each variable. Instead of manually inputting the number 237, I want the sampsize to be equal to the number of rows of dataset C (since the number of rows of this dataset will change depending on the data I use). How can I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2016 18:06:28 GMT</pubDate>
    <dc:creator>TrueTears</dc:creator>
    <dc:date>2016-01-05T18:06:28Z</dc:date>
    <item>
      <title>Dynamic sampsize in proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241864#M55742</link>
      <description>&lt;P&gt;I am using proc surveyselect for unrestricted random sampling, my code is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc surveyselect data=A out=B
     seed = 1234 method = urs
	 sampsize=237 /* This is the number of rows of a dataset called C, which has already been created*/
     outhits rep = 1;
run;
ods listing close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My input datafile is called A and output datafile is called B.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have another dataset called C (which is different from the input file A) and it has 237 rows, i.e., 237 observations for each variable. Instead of manually inputting the number 237, I want the sampsize to be equal to the number of rows of dataset C (since the number of rows of this dataset will change depending on the data I use). How can I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 18:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241864#M55742</guid>
      <dc:creator>TrueTears</dc:creator>
      <dc:date>2016-01-05T18:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sampsize in proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241867#M55743</link>
      <description>&lt;P&gt;Rather than sampsize use samprate=1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=sashelp.class out=class
     seed = 1234 method = urs
samprate=1 /* This is the number of rows of a dataset called C, which has already been created*/
     outhits rep = 1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2016 17:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241867#M55743</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-05T17:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sampsize in proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241868#M55744</link>
      <description>&lt;P&gt;But doesn't samprate=1 create a sample size equal to the size of the INPUT datafile? In my case, the input datafile is called "A", but I want the size to be equal to that of a datafile called "C", which is NOT the input data; they have different sizes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I achieve this?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 18:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241868#M55744</guid>
      <dc:creator>TrueTears</dc:creator>
      <dc:date>2016-01-05T18:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sampsize in proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241869#M55745</link>
      <description>Then I would suggest a macro variable to get the size of dataset C and use that in your proc surveyselect. Sampsize/Samprate also take datasets so you could create a dataset with the information as well.</description>
      <pubDate>Tue, 05 Jan 2016 18:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241869#M55745</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-05T18:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sampsize in proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241871#M55746</link>
      <description>&lt;P&gt;Thanks, this is what I was thinking of, however I am quite new to SAS. Any chance you can provide a skeleton template code for me to edit?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 18:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241871#M55746</guid>
      <dc:creator>TrueTears</dc:creator>
      <dc:date>2016-01-05T18:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sampsize in proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241872#M55747</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select count(*) into :record_count
from c;
quit;

%put &amp;amp;record_count;

proc surveyselect data=a out=b
     seed = 1234 method = urs
sampsize=&amp;amp;record_count /* This is the number of rows of a dataset called C, which has already been created*/
     outhits rep = 1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2016 18:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Dynamic-sampsize-in-proc-surveyselect/m-p/241872#M55747</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-05T18:12:39Z</dc:date>
    </item>
  </channel>
</rss>

