<?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 How to select part of the data using proc sql? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975195#M84050</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data set is huge. I don't want to use the whole data set during programming.&amp;nbsp; How do I select certain amount of data for each category with proc sql, for example, to get 10 obs for each state/sex/age group?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Qinghe&lt;/P&gt;</description>
    <pubDate>Wed, 17 Sep 2025 01:13:04 GMT</pubDate>
    <dc:creator>qinghe</dc:creator>
    <dc:date>2025-09-17T01:13:04Z</dc:date>
    <item>
      <title>How to select part of the data using proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975195#M84050</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data set is huge. I don't want to use the whole data set during programming.&amp;nbsp; How do I select certain amount of data for each category with proc sql, for example, to get 10 obs for each state/sex/age group?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Qinghe&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 01:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975195#M84050</guid>
      <dc:creator>qinghe</dc:creator>
      <dc:date>2025-09-17T01:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to select part of the data using proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975205#M84051</link>
      <description>&lt;P&gt;Is your aim to create a smaller permanent data set?&lt;/P&gt;
&lt;P&gt;Why limit yourself to SQL?&lt;/P&gt;
&lt;P&gt;If you have SAS/STAT licensed PROC SURVEYSELECT is your go-to for creating samples.&lt;/P&gt;
&lt;P&gt;If our data set is sorted, you could use a data step to read the first &lt;EM&gt;n&lt;/EM&gt; observations of the specified BY groups.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 06:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975205#M84051</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-09-17T06:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to select part of the data using proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975209#M84052</link>
      <description>&lt;P&gt;An example for using a sorted dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
_n_ = 1;
do until (last.state);
  set have;
  by state;
  if _n_ le 10 then output;
  _n_ + 1;
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Sep 2025 07:41:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-select-part-of-the-data-using-proc-sql/m-p/975209#M84052</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-09-17T07:41:32Z</dc:date>
    </item>
  </channel>
</rss>

