<?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: Subset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875545#M345941</link>
    <description>&lt;P&gt;Another common technique to do this is to limit the number of rows read.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have (obs = 100);
 &amp;lt;My logic here&amp;gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 May 2023 23:05:39 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-05-12T23:05:39Z</dc:date>
    <item>
      <title>Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875517#M345930</link>
      <description>What is the command to run the transformation (within a data step)&lt;BR /&gt;To only a small no of rows?</description>
      <pubDate>Fri, 12 May 2023 20:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875517#M345930</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-05-12T20:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875518#M345931</link>
      <description>&lt;P&gt;You need to provide more details about what you are trying to do to get a better answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general to execute some statements for only some of the observations you would use an IF statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
   if sex='M' then do;
     num_births=.;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2023 20:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875518#M345931</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-12T20:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875545#M345941</link>
      <description>&lt;P&gt;Another common technique to do this is to limit the number of rows read.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have (obs = 100);
 &amp;lt;My logic here&amp;gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 23:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875545#M345941</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-05-12T23:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875555#M345945</link>
      <description>&lt;P&gt;yes this is what I know. but my boss said even if I have many data step for different datasets, I can just add some statement at the top and it can apply to all subsequent data steps say only 10 obs for each dataset in each data step but only need to specify once, have you heard??&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2023 01:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875555#M345945</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-05-13T01:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875557#M345947</link>
      <description>&lt;P&gt;You could use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=10;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which will imply an &lt;EM&gt;&lt;STRONG&gt;(OBS=10)&lt;/STRONG&gt;&lt;/EM&gt; dataset name parameter for all datasets in a SET or MERGE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Editted note:&amp;nbsp; you can use this options obs=&amp;nbsp; &amp;nbsp;statement anywhere in the program, and it will be honored for the rest of the program until overwritten.&amp;nbsp; The default value is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=max;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 May 2023 02:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875557#M345947</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-05-13T02:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875788#M346050</link>
      <description>&lt;P&gt;does this include set statement inside a macro ?&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 11:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875788#M346050</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-05-15T11:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875789#M346051</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;does this include set statement inside a macro ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although I will give you a hint ... if the macro creates valid SAS code, then the macro should run.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 11:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875789#M346051</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-15T11:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875796#M346055</link>
      <description>&lt;P&gt;OBS= is a&amp;nbsp;&lt;STRONG&gt;system&lt;/STRONG&gt; option. Think about the meaning of "system" &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 11:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subset/m-p/875796#M346055</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-15T11:49:54Z</dc:date>
    </item>
  </channel>
</rss>

