<?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: proc surveyselec in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178648#M34139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to indicate what you are trying to do. You're macro creates a local macro variable six times, each time discarding the previous version. I don't understand its purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your 2nd where statement doesn't make sense (to me). While you have shown any example data, a statement like:&lt;/P&gt;&lt;P&gt;where initialer ne 1, 3, 5;&lt;/P&gt;&lt;P&gt;won't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you post some sample data, explain what you want to accomplish and, based on the sample data, what resulting file you want to obtain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Feb 2015 18:51:24 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2015-02-22T18:51:24Z</dc:date>
    <item>
      <title>proc surveyselect</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178645#M34136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo SAS community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am stuck with a problem i hope you can help me with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc surveyselect data= xxx.X201202&amp;nbsp; method=srs n=200 seed=200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=test1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where department ne "AgroTech A/S";&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, i want to create a macro which loop through the data set&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Samlple1 .... Sample6&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the variable "Initials" from the sample1-6 is the same as initials in xxx.X201202 then these observationses should not be a part of the random sample of 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can help me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 14:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178645#M34136</guid>
      <dc:creator>Jens_v</dc:creator>
      <dc:date>2015-02-22T14:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178646#M34137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand your question. If you simply want to randomly assign people to six different groups, without replication, then take a look at: &lt;A href="http://support.sas.com/kb/36/383.html" title="http://support.sas.com/kb/36/383.html"&gt;36383 - Randomly assign the observations in a data set to two or more groups&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 16:35:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178646#M34137</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-22T16:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178647#M34138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to make following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Udklip.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9250_Udklip.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I have no idea if this is the right way to go. I hope you understand what my problem is...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 18:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178647#M34138</guid>
      <dc:creator>Jens_v</dc:creator>
      <dc:date>2015-02-22T18:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178648#M34139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to indicate what you are trying to do. You're macro creates a local macro variable six times, each time discarding the previous version. I don't understand its purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your 2nd where statement doesn't make sense (to me). While you have shown any example data, a statement like:&lt;/P&gt;&lt;P&gt;where initialer ne 1, 3, 5;&lt;/P&gt;&lt;P&gt;won't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you post some sample data, explain what you want to accomplish and, based on the sample data, what resulting file you want to obtain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 18:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178648#M34139</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-22T18:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178649#M34140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo again and thank you for your patience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data set 1&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); width: 370px; height: 58px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Initials&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Company&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Cost&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;KLO&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;AgroTech A/S&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;AVG&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;LEGO&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;SLO&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&amp;amp;O&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;53000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;NRL&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;AgroTech A/S&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;98000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;PLA&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;INFINION&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;15244&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;n&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data set 2&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" style="border: 1px solid #000000; width: 192px; height: 160px;" width="190"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="color: #ffffff; font-size: 13.3333330154419px; text-align: center; background-color: #6690bc;"&gt;Initials&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;AVG&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;KLP&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;QGY&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;DGY&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;MNJ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;n&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data set 3&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid #000000; width: 181px; height: 102px;" width="179"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Initials&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;PLA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;GTX&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;MLO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;BBN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;n&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;DYU&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to do is to make an random sample of "data set 1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I do not want to include observations with the same initials from data set 2 and 3. Therefore the random sample must not include obs 2 and 5, because their initials occur in data set 2 and 3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 17:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178649#M34140</guid>
      <dc:creator>Jens_v</dc:creator>
      <dc:date>2015-02-23T17:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178650#M34141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you are trying to do something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data initials;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sample1 sample2 sample3 sample4 sample5 sample6;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct quote(strip(initials))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :initials separated by ','&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from initials&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc surveyselect data=x201202 method=srs n=200 seed=200&lt;/P&gt;&lt;P&gt;&amp;nbsp; out=test005;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where afdeling ne "AgroTech A/S" and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialer not in (&amp;amp;initials.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 18:26:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178650#M34141</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-23T18:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178651#M34142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might want to read the article &lt;A href="http://blogs.sas.com/content/iml/2014/01/29/sample-with-replacement-in-sas/"&gt;"Sample with replacement in SAS"&lt;/A&gt; which discusses some of the issues and techniques for sampling with replacement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2015 13:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178651#M34142</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-02-25T13:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc surveyselec</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178652#M34143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, what I understand is that you already have samples and you want the new sample to exclude cases already selected. Try this (not tested) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Create a&amp;nbsp; set of existing samples */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data sampSet / view=sampSet;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set xxx.sample:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep initials;&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;/* Create a subset of x201202 excluding existing samples */&lt;/STRONG&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 view newSet as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from xxx.X201202&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; initials not in (select initials from sampSet);&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;&lt;STRONG&gt;/* Create a new sample from X201202, excluding previous samples */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call surveyselect data=newSet method=srs n=200 seed=200 out=test005;&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;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2015 18:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-surveyselect/m-p/178652#M34143</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-02-25T18:40:47Z</dc:date>
    </item>
  </channel>
</rss>

