<?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: Macros for extracting observation from dataset in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547400#M3785</link>
    <description>&lt;P&gt;Much better do do it with the respective dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newfile;
set datafile (firstobs=5 obs=14);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You do not do &lt;EM&gt;data&lt;/EM&gt; manipulation with the macro preprocessor. The macro preprocessor is for creating dynamic &lt;EM&gt;code&lt;/EM&gt;. So unless there is something in this code that you want to make dynamic, there is no need for macro processing.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Mar 2019 09:15:32 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-03-30T09:15:32Z</dc:date>
    <item>
      <title>Macros for extracting observation from dataset</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547399#M3784</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;following data step extracting data from 5th observation to 10th observation from datafile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data newfile;&lt;BR /&gt;set datafile;&lt;BR /&gt;if _N_ in (5,6,7,8,9,10,11,12,13,14) then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying same output using macros but it could not give result&lt;/P&gt;&lt;P&gt;I use %obs()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any one can help me on this&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 08:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547399#M3784</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-30T08:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for extracting observation from dataset</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547400#M3785</link>
      <description>&lt;P&gt;Much better do do it with the respective dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newfile;
set datafile (firstobs=5 obs=14);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You do not do &lt;EM&gt;data&lt;/EM&gt; manipulation with the macro preprocessor. The macro preprocessor is for creating dynamic &lt;EM&gt;code&lt;/EM&gt;. So unless there is something in this code that you want to make dynamic, there is no need for macro processing.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 09:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547400#M3785</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-30T09:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for extracting observation from dataset</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547405#M3786</link>
      <description>&lt;P&gt;Yes it is much better and easy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot sir.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 09:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547405#M3786</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-30T09:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for extracting observation from dataset</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547406#M3787</link>
      <description>&lt;P&gt;An example for dynamic code expanded from the current one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymac(fobs,lobs);

data newfile;
set datafile (firstobs=&amp;amp;fobs. obs=&amp;amp;lobs.);
run;

%mend;

%mymac(5,14)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The "action" is still in the data step, but the parameters are now dynamic.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 09:47:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547406#M3787</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-30T09:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for extracting observation from dataset</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547407#M3788</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;same result appear as you code in macros&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 09:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Macros-for-extracting-observation-from-dataset/m-p/547407#M3788</guid>
      <dc:creator>uspanchal</dc:creator>
      <dc:date>2019-03-30T09:52:38Z</dc:date>
    </item>
  </channel>
</rss>

