<?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 Output dataset has x amount or records in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211916#M52355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;, HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will like to create a query using PROC SQL or a DATA Step and have SAS gave me an output dataset with only 10 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have a dataset named 'have' with 1 million records and I am running an certain functions ans if/then statements.&amp;nbsp; I am limiting my output if certain conditions are met.&lt;/P&gt;&lt;P&gt;Can I limit processing based on the number of records present in the output dataset?&amp;nbsp; When output dataset "want" has 10 observations then stop processing and output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jul 2015 16:42:05 GMT</pubDate>
    <dc:creator>ismahero2</dc:creator>
    <dc:date>2015-07-27T16:42:05Z</dc:date>
    <item>
      <title>Output dataset has x amount or records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211916#M52355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;, HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will like to create a query using PROC SQL or a DATA Step and have SAS gave me an output dataset with only 10 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have a dataset named 'have' with 1 million records and I am running an certain functions ans if/then statements.&amp;nbsp; I am limiting my output if certain conditions are met.&lt;/P&gt;&lt;P&gt;Can I limit processing based on the number of records present in the output dataset?&amp;nbsp; When output dataset "want" has 10 observations then stop processing and output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 16:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211916#M52355</guid>
      <dc:creator>ismahero2</dc:creator>
      <dc:date>2015-07-27T16:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Output dataset has x amount or records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211917#M52356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql inobs=10;&lt;/P&gt;&lt;P&gt;select * from sashelp.class;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.class(obs=10);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 16:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211917#M52356</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-07-27T16:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Output dataset has x amount or records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211918#M52357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll change the 5 to 10 for your purpose but this will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards dsd;&lt;/P&gt;&lt;P&gt;input input;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options obs=5;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql outobs=5;&lt;/P&gt;&lt;P&gt;create table want2 as&lt;/P&gt;&lt;P&gt;select * from have;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 16:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211918#M52357</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-27T16:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Output dataset has x amount or records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211919#M52358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there's a way to control the number of outobs in a data step. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use OBS= option, either globally through an option statement or as a dataset option to limit the input data size. If your if/then options don't elimininate observations or control output this should be fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use OUTOBS in SQL to limit the number of output obs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the purpose is testing for development, I tend to use the global OBS= option and then reset it when I'm done. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 16:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Output-dataset-has-x-amount-or-records/m-p/211919#M52358</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-27T16:57:58Z</dc:date>
    </item>
  </channel>
</rss>

